]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Switch to PlayerDied.
authorLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 18:02:27 +0000 (21:02 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 18:02:27 +0000 (21:02 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc

index 3740e7e470f2831b0bc8b3f50c1cbde75512c430..2bed1d7cab17d8640d825996d3489107d98de9ba 100644 (file)
@@ -1747,7 +1747,6 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDies)
 {
        //FOREACH_CLIENT(true, { centerprint(it, "PlayerDies"); });
        entity frag_target = M_ARGV(2, entity);
-       Surv_CountAlivePlayers(frag_target.team);
        //surv_RemovePlayerFromAliveList(frag_target);
        if (!Surv_CanPlayerSpawn(frag_target))
        {
@@ -1760,6 +1759,12 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDies)
        return true;
 }
 
+/// \brief Hook which is called after the player died.
+MUTATOR_HOOKFUNCTION(surv, PlayerDied)
+{
+       Surv_CountAlivePlayers(-1);
+}
+
 /// \brief Hook which is called when player has scored a frag.
 MUTATOR_HOOKFUNCTION(surv, GiveFragsForKill, CBC_ORDER_FIRST)
 {