From: bones_was_here Date: Wed, 23 Nov 2022 15:14:31 +0000 (+1000) Subject: Block spectators from changing their ready status X-Git-Tag: xonotic-v0.8.6~179^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c59fcef6877f5f8c9598fe387c10399e93dde18b;p=xonotic%2Fxonotic-data.pk3dir.git Block spectators from changing their ready status This is consistent with the existing behaviour of setting .ready to false when a player switches to spectating. Also reduces indenting and removes a condition that's no longer needed since sv_ready_restart was removed. --- diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index e2d71597f..50b71957b 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -374,27 +374,22 @@ void ClientCommand_ready(entity caller, int request) case CMD_REQUEST_COMMAND: { if (IS_CLIENT(caller) && caller.last_ready < time - 3) + if (warmup_stage || g_race_qualifying == 2) + if (IS_PLAYER(caller) || INGAME_JOINED(caller)) { - if (warmup_stage || g_race_qualifying == 2) + if (caller.ready) // toggle { - if (time < game_starttime) // game is already restarting - return; - if (caller.ready) // toggle - { - caller.ready = false; - if (IS_PLAYER(caller) || INGAME_JOINED(caller)) - bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); - } - else - { - caller.ready = true; - if (IS_PLAYER(caller) || INGAME_JOINED(caller)) - bprint(playername(caller.netname, caller.team, false), "^2 is ready\n"); - } - - caller.last_ready = time; - ReadyCount(); + caller.ready = false; + bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n"); } + else + { + caller.ready = true; + bprint(playername(caller.netname, caller.team, false), "^2 is ready\n"); + } + + caller.last_ready = time; + ReadyCount(); } return; // never fall through to usage }