From: terencehill Date: Thu, 7 Jul 2022 16:31:26 +0000 (+0200) Subject: Set lms_spectate right when player is moved to spectator, not when the spectate comma... X-Git-Tag: xonotic-v0.8.6~67^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=afafd337280b36a92917aaa0ab0147c10928b121;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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; }