Skip to content

Commit

Permalink
fix(random_shop): Do not put minimum player limited equip in random shop
Browse files Browse the repository at this point in the history
This fixes #1679, very well aware that other limitations (team/global
limited) are still not respected and might still show up.
  • Loading branch information
Histalek committed Nov 27, 2024
1 parent ff812c7 commit ccf3f38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gamemodes/terrortown/gamemode/shared/sh_equip_items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ if SERVER then
RANDOMSHOP[ply] = RANDOMTEAMSHOPS[GetShopFallback(srd.index)]
end
else -- every player has his own shop
local activePlys = util.GetActivePlayers()

for i = 1, #tmpTbl do
local ply = tmpTbl[i]
local srd = ply:GetSubRoleData()
Expand All @@ -592,6 +594,12 @@ if SERVER then
continue
end

if equip.minPlayers and equip.minPlayers > 1 then
if #activePlys < equip.minPlayers then
continue
end
end

if equip.NoRandom then
amount = amount - 1

Expand Down

0 comments on commit ccf3f38

Please sign in to comment.