Skip to content

Commit

Permalink
add missing args
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 committed Mar 4, 2024
1 parent 1f00205 commit 6a79f74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gamemodes/terrortown/gamemode/server/sv_roleselection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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) -- if the player wants the role
local giveIfWanted = ply:CanSelectRole(subrole, #plys, roleAmount) -- 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)
Expand Down Expand Up @@ -881,7 +881,7 @@ local function SelectBaseRolePlayers(plys, subrole, roleAmount)
-- the player we consider
local ply = plys[pick]

local giveIfWanted = ply:CanSelectRole(subrole) -- if the player wants the role
local giveIfWanted = ply:CanSelectRole(subrole, #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
Expand Down

0 comments on commit 6a79f74

Please sign in to comment.