]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Campaign, LMS level: end game as soon as player loses; it fixes #1857
authorterencehill <piuntn@gmail.com>
Wed, 31 Jan 2018 15:15:58 +0000 (16:15 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 31 Jan 2018 15:15:58 +0000 (16:15 +0100)
qcsrc/server/mutators/mutator/gamemode_lms.qc

index c281424a076d5688ac6fac9a936ca22f9501ba27..94c4a998c2cc616b4d3f1f64487eb4b5fb98e42e 100644 (file)
@@ -48,6 +48,16 @@ int WinningCondition_LMS()
                if (total_players > 1)
                {
                        // two or more active players - continue with the game
+
+                       if (autocvar_g_campaign)
+                       {
+                               FOREACH_CLIENT(IS_REAL_CLIENT(it), {
+                                       float pl_lives = GameRules_scoring_add(it, LMS_LIVES, 0);
+                                       if (!pl_lives)
+                                               return WINNING_YES; // human player lost, game over
+                                       break;
+                               });
+                       }
                }
                else
                {