]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_ca.qc
Merge branch 'TimePath/killself' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_ca.qc
index c90f7d1787c2aef9f56467560e59e98b0eb9dfd8..8835d11a9cdaac326642cb9811bfb2986dd699af 100644 (file)
@@ -47,7 +47,7 @@ REGISTER_MUTATOR(ca, false)
                EliminatedPlayers_Init(ca_isEliminated);
 
                ActivateTeamplay();
-               SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, -1, -1);
+               SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, autocvar_timelimit_override, -1);
 
                if (autocvar_g_ca_team_spawns)
                        have_team_spawns = -1; // request team spawns
@@ -231,7 +231,7 @@ MUTATOR_HOOKFUNCTION(ca, PutClientInServer)
     SELFPARAM();
        if (!allowed_to_spawn && IS_PLAYER(this)) // this is true even when player is trying to join
        {
-               this.classname = STR_OBSERVER;
+               TRANSMUTE(Observer, this);
                if (this.jointime != time && !this.caplayer) // not when connecting
                {
                        this.caplayer = 0.5;
@@ -251,9 +251,9 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
                }
                if (it.caplayer)
                {
-                       it.classname = STR_PLAYER;
+                       TRANSMUTE(Player, it);
                        it.caplayer = 1;
-                       WITH(entity, self, it, PutClientInServer());
+                       WITHSELF(it, PutClientInServer());
                }
        });
        return true;
@@ -262,7 +262,7 @@ MUTATOR_HOOKFUNCTION(ca, reset_map_players)
 MUTATOR_HOOKFUNCTION(ca, ClientConnect)
 {
     SELFPARAM();
-       this.classname = STR_OBSERVER;
+       TRANSMUTE(Observer, this);
        return true;
 }
 
@@ -330,7 +330,7 @@ MUTATOR_HOOKFUNCTION(ca, ForbidPlayerScore_Clear)
 MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
 {
     SELFPARAM();
-       if (this.caplayer == 1)
+       if (!IS_DEAD(this))
                ca_LastPlayerForTeam_Notify();
        if (this.killindicator_teamchange == -2)
                this.caplayer = 0;