]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set lms_spectate right when player is moved to spectator, not when the spectate comma...
authorterencehill <piuntn@gmail.com>
Thu, 7 Jul 2022 16:31:26 +0000 (18:31 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 7 Jul 2022 16:31:26 +0000 (18:31 +0200)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index db81f0d34d41c34ba25fa1dffa5685d198362638..2d7f724a1032cc3114c60ca862fe28ce6745abc9 100644 (file)
@@ -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;
 }