From: terencehill Date: Mon, 19 Aug 2019 23:57:51 +0000 (+0200) Subject: Fix #2267 "Teams get shuffled every round in CA and FT" (whenever a sv_cmd command... X-Git-Tag: xonotic-v0.8.5~1381^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7a4eff25bbbefc9accd6091a8a6232fdff634347;p=xonotic%2Fxonotic-data.pk3dir.git Fix #2267 "Teams get shuffled every round in CA and FT" (whenever a sv_cmd command is executed in the console during a round) --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc index 0a8370899..cf2821844 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc @@ -508,6 +508,8 @@ MUTATOR_HOOKFUNCTION(ca, SetWeaponArena) MUTATOR_HOOKFUNCTION(ca, SV_ParseServerCommand) { - shuffleteams_on_reset_map = !allowed_to_spawn; + string cmd_name = M_ARGV(0, string); + if (cmd_name == "shuffleteams") + shuffleteams_on_reset_map = !allowed_to_spawn; return false; } diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 2dfcf4811..0f37cf1e8 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@ -612,7 +612,9 @@ MUTATOR_HOOKFUNCTION(ft, FragCenterMessage) MUTATOR_HOOKFUNCTION(ft, SV_ParseServerCommand) { - shuffleteams_on_reset_map = !(round_handler_IsActive() && !round_handler_IsRoundStarted()); + string cmd_name = M_ARGV(0, string); + if (cmd_name == "shuffleteams") + shuffleteams_on_reset_map = !(round_handler_IsActive() && !round_handler_IsRoundStarted()); return false; }