From c90dc836dff2f614b269bd44db3183337cfd5d77 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 17 Jun 2021 14:39:06 +0200 Subject: [PATCH] Reimplement commit a484f02 "LMS: don't show "respawning in x seconds" after losing your last life (the same trick is used in CA)" that was lost lost in the previous merge commit --- qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 1d4732692..1778e34be 100644 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@ -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, { -- 2.39.2