Merge branch 'Mario/cts_respawn_clear' into 'master'
authorMario <zacjardine@y7mail.com>
Tue, 16 May 2017 22:15:33 +0000 (22:15 +0000)
committerMario <zacjardine@y7mail.com>
Tue, 16 May 2017 22:15:33 +0000 (22:15 +0000)
Merge branch Mario/cts_respawn_clear (S merge request)

See merge request !432

qcsrc/server/client.qc
qcsrc/server/mutators/mutator/gamemode_race.qc
qcsrc/server/player.qc

index 95f28752714a9c322ebfb08ba67cf0ffbcb930e6..d705fd63abc7e087d701bf448c12e0ed8485cdab 100644 (file)
@@ -910,7 +910,7 @@ void KillIndicator_Think(entity this)
                ClientKill_Now(this.owner);
                return;
        }
-    else if(g_cts && this.health == 1) // health == 1 means that it's silent
+    else if(this.health == 1) // health == 1 means that it's silent
     {
         this.nextthink = time + 1;
         this.cnt -= 1;
@@ -940,11 +940,9 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change,
 
        killtime = autocvar_g_balance_kill_delay;
 
-       if(g_race_qualifying || g_cts)
-               killtime = 0;
-
     if(MUTATOR_CALLHOOK(ClientKill, this, killtime))
        return;
+    killtime = M_ARGV(1, float);
 
        this.killindicator_teamchange = targetteam;
 
index c41586c0464d141bcdfb90c1840277688af2a52a..c4c8f087e495d388dfc360ca3cc895724894b771 100644 (file)
@@ -102,6 +102,12 @@ float WinningCondition_QualifyingThenRace(float limit)
        return wc;
 }
 
+MUTATOR_HOOKFUNCTION(rc, ClientKill)
+{
+       if(g_race_qualifying)
+               M_ARGV(1, float) = 0; // killtime
+}
+
 MUTATOR_HOOKFUNCTION(rc, AbortSpeedrun)
 {
        entity player = M_ARGV(0, entity);
index f22ff0daf8f5d1617fcda9cb121e96466c475857..faa3c810137a4628ae82b585d43cdcbd1def147c 100644 (file)
@@ -253,7 +253,7 @@ void calculate_player_respawn_time(entity this)
                ));
                if (sdelay_small_count == 0)
                {
-                       if (g_cts)
+                       if (IS_INDEPENDENT_PLAYER(this))
                        {
                                // Players play independently. No point in requiring enemies.
                                sdelay_small_count = 1;
@@ -266,7 +266,7 @@ void calculate_player_respawn_time(entity this)
                }
                if (sdelay_large_count == 0)
                {
-                       if (g_cts)
+                       if (IS_INDEPENDENT_PLAYER(this))
                        {
                                // Players play independently. No point in requiring enemies.
                                sdelay_large_count = 1;