From 33904af94e68adc4d99ff09e8c467c10a4b454d4 Mon Sep 17 00:00:00 2001 From: Histalek <16392835+Histalek@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:51:11 +0100 Subject: [PATCH] fix(random_shop): Do not put minimum player limited equip in random shop This fixes #1679, very well aware that other limitations (team/global limited) are still not respected and might still show up. --- gamemodes/terrortown/gamemode/shared/sh_equip_items.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua b/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua index fc60669df..b23e32522 100644 --- a/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua +++ b/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua @@ -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() @@ -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