]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
LMS: don't show "respawning in x seconds" after losing your last life (the same trick...
authorterencehill <piuntn@gmail.com>
Sun, 7 Feb 2021 11:32:31 +0000 (12:32 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 7 Feb 2021 11:32:31 +0000 (12:32 +0100)
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc

index ba45f6e7ebd12bfb26259986cd1148f9076c33ec..d35da5186913044842cfee135512176d9700163f 100644 (file)
@@ -174,6 +174,13 @@ MUTATOR_HOOKFUNCTION(lms, PlayerDies)
 {
        entity frag_target = M_ARGV(2, entity);
 
+       float tl = GameRules_scoring_add(frag_target, LMS_LIVES, 0);
+       if (tl <= 0)
+       {
+               frag_target.respawn_flags = RESPAWN_SILENT;
+               // prevent unwanted sudden rejoin as spectator and movement of spectator camera
+               frag_target.respawn_time = time + 2;
+       }
        frag_target.respawn_flags |= RESPAWN_FORCE;
 }