From: terencehill Date: Thu, 17 Jun 2021 12:39:06 +0000 (+0200) Subject: Reimplement commit a484f02 "LMS: don't show "respawning in x seconds" after losing... X-Git-Tag: xonotic-v0.8.6~426^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c90dc836dff2f614b269bd44db3183337cfd5d77;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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, {