]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Survival: Better eliminated players handling.
authorLyberta <lyberta@lyberta.net>
Wed, 29 Mar 2017 12:33:09 +0000 (15:33 +0300)
committerLyberta <lyberta@lyberta.net>
Wed, 29 Mar 2017 12:33:09 +0000 (15:33 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc

index 3d0748d39d2a3dc9890adba177b5878b4c01e4c9..38d3cf6da3d0a75909f30b4f442f261544012d11 100644 (file)
@@ -323,8 +323,7 @@ void Surv_ChangeNumberOfAlivePlayers(int teamnum, int delta)
                        LOG_TRACE("Number of alive attackers = ", ftos(
                                surv_numattackersalive), " was = ", ftos(surv_numattackersalive
                                - delta));
-                       Surv_UpdateAliveStats();
-                       return;
+                       break;
                }
                case surv_defenderteam:
                {
@@ -332,10 +331,11 @@ void Surv_ChangeNumberOfAlivePlayers(int teamnum, int delta)
                        LOG_TRACE("Number of alive defenders = ", ftos(
                                surv_numdefendersalive), " was = ", ftos(surv_numdefendersalive
                                - delta));
-                       Surv_UpdateAliveStats();
-                       return;
+                       break;
                }
        }
+       Surv_UpdateAliveStats();
+       eliminatedPlayers.SendFlags |= 1;
 }
 
 /// \brief Sets the player role.
@@ -736,11 +736,8 @@ void Surv_CountAlivePlayers()
                        }
                }
        });
-       if (!warmup_stage)
-       {
-               eliminatedPlayers.SendFlags |= 1;
-       }
        Surv_UpdateAliveStats();
+       eliminatedPlayers.SendFlags |= 1;
        if (warmup_stage || surv_allowed_to_spawn || (savednumdefenders <=
                surv_numdefendersalive))
        {
@@ -1518,10 +1515,6 @@ MUTATOR_HOOKFUNCTION(surv, MakePlayerObserver)
                LOG_TRACE("killindicator_teamchange == -2");
                player.surv_state = SURVIVAL_STATE_NOT_PLAYING;
        }
-       if (!warmup_stage)
-       {
-               eliminatedPlayers.SendFlags |= 1;
-       }
        if (player.surv_state == SURVIVAL_STATE_NOT_PLAYING)
        {
                return false;  // allow team reset