Skip to content

Commit

Permalink
Return if classname equals player's class
Browse files Browse the repository at this point in the history
  • Loading branch information
a-blob committed Jan 29, 2024
1 parent 5aaddd2 commit 3a1705c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mods/ctf/ctf_modes/ctf_mode_classes/classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ local function select_class(player, classname)
player = PlayerObj(player)
if not player then return end

if classname == classes.get_name(player) then
return
end

if ctf_modebase.current_mode == "classes" and dist_from_flag(player) <= 5 then
cooldowns:set(player, CLASS_SWITCH_COOLDOWN)
classes.set(player, classname)
Expand Down

0 comments on commit 3a1705c

Please sign in to comment.