From c9444683b86bde7d79ccc800cc30fee30433eb28 Mon Sep 17 00:00:00 2001 From: techbot Date: Mon, 4 Mar 2024 23:52:37 +0100 Subject: [PATCH] grr --- gamemodes/terrortown/gamemode/server/sv_roleselection.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamemodes/terrortown/gamemode/server/sv_roleselection.lua b/gamemodes/terrortown/gamemode/server/sv_roleselection.lua index b795175d68..231722fb1f 100644 --- a/gamemodes/terrortown/gamemode/server/sv_roleselection.lua +++ b/gamemodes/terrortown/gamemode/server/sv_roleselection.lua @@ -655,7 +655,7 @@ local function SetSubRoles(plys, availableRoles, selectableRoles, selectedForced local minKarmaCVar = GetConVar("ttt_" .. roleData.name .. "_karma_min") local minKarma = minKarmaCVar and minKarmaCVar:GetInt() or 0 - local giveIfWanted = ply:CanSelectRole(subrole, #plys, roleAmount) -- if the player wants the role + local giveIfWanted = ply:CanSelectRole(roleData, #plys, availableRolesAmount) -- if the player wants the role and ply:GetBaseKarma() > minKarma -- and the player has enough karma local giveIfVariety = plysAmount <= roleCount -- or if there aren't enough players anymore to have a greater role variety local giveIfRandom = math.random(RANDOMFORCEROLE_CHANCE) == 1 -- or if the randomness decides (to avoid deadlocks) @@ -881,7 +881,7 @@ local function SelectBaseRolePlayers(plys, subrole, roleAmount) -- the player we consider local ply = plys[pick] - local giveIfWanted = ply:CanSelectRole(subrole, #plys, roleAmount) -- if the player wants the role + local giveIfWanted = ply:CanSelectRole(roleData, #plys, roleAmount) -- if the player wants the role and ply:GetBaseKarma() > min_karmas -- and the player has enough karma local giveIfInnocent = subrole == ROLE_INNOCENT -- or if the role is innocent (players cannot avoid being innocent) local giveIfVariety = #plys <= curRoles -- or there aren't enough players anymore to have a greater role variety