]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reimplement commit a484f02 "LMS: don't show "respawning in x seconds" after losing...
authorterencehill <piuntn@gmail.com>
Thu, 17 Jun 2021 12:39:06 +0000 (14:39 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 17 Jun 2021 12:39:06 +0000 (14:39 +0200)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index 1d47326929b7851dcd8e24b3676a0d22d71cb6b0..1778e34be2959d4d03a044237164663dccb2c83c 100644 (file)
@@ -177,10 +177,18 @@ MUTATOR_HOOKFUNCTION(lms, CalculateRespawnTime)
        entity player = M_ARGV(0, entity);
        player.respawn_flags |= RESPAWN_FORCE;
 
+       int pl_lives = GameRules_scoring_add(player, LMS_LIVES, 0);
+       if (pl_lives <= 0)
+       {
+               player.respawn_flags = RESPAWN_SILENT;
+               // prevent unwanted sudden rejoin as spectator and movement of spectator camera
+               player.respawn_time = time + 2;
+               return true;
+       }
+
        if (autocvar_g_lms_dynamic_respawn_delay <= 0)
                return false;
 
-       int pl_lives = GameRules_scoring_add(player, LMS_LIVES, 0);
        int max_lives = 0;
        int pl_cnt = 0;
        FOREACH_CLIENT(it != player && IS_PLAYER(it) && it.frags != FRAGS_PLAYER_OUT_OF_GAME, {