From afafd337280b36a92917aaa0ab0147c10928b121 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 7 Jul 2022 18:31:26 +0200 Subject: [PATCH] Set lms_spectate right when player is moved to spectator, not when the spectate command is called otherwise bad things can happen if spectate is immediately followed by a kill command call cancelling spectate --- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index db81f0d34..2d7f724a1 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -402,7 +402,7 @@ MUTATOR_HOOKFUNCTION(lms, MakePlayerObserver) } else { - if (is_forced) + if (is_forced || player.killindicator_teamchange == -2) // player is forced or wants to spectate player.lms_spectate = true; if (!GameRules_scoring_add(player, LMS_RANK, 0)) lms_RemovePlayer(player); @@ -686,10 +686,7 @@ MUTATOR_HOOKFUNCTION(lms, ClientCommand_Spectate) { entity player = M_ARGV(0, entity); if(player.frags != FRAGS_SPECTATOR && player.frags != FRAGS_PLAYER_OUT_OF_GAME) - { - player.lms_spectate = true; return MUT_SPECCMD_CONTINUE; - } // ranked players (out of game) can no longer become real spectators return MUT_SPECCMD_RETURN; } -- 2.39.5