diff --git a/CHANGELOG.md b/CHANGELOG.md index 42814b8d7..f4a1d7ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel - Fixed spectating player still being visible through thermalvision after killing that player (by @MrXonte) - Fixed Magneto-stick not using C_Hands (by @SvveetMavis) - Fixed console error when dropping ammo for weapons with no AmmoEnt (by @MrXonte) +- Fixed randomshop containing equipment which minimum playeramount was not satisfied (by @Histalek) ### Changed diff --git a/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua b/gamemodes/terrortown/gamemode/shared/sh_equip_items.lua index 4a6ef3d2b..f581951e4 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() @@ -590,6 +592,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