]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
explicitly allow an instant kill after player finished a CTS run, add a comment
authorFruitieX <fruitiex@gmail.com>
Sun, 12 Dec 2010 12:26:20 +0000 (14:26 +0200)
committerFruitieX <fruitiex@gmail.com>
Sun, 12 Dec 2010 12:26:20 +0000 (14:26 +0200)
qcsrc/server/cl_client.qc

index ba6c2e5781486f7e037c3c21e0a0b7e2b0d5bbac..707d36ededa4565e79c4f62a05565fb73443432a 100644 (file)
@@ -1311,6 +1311,15 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
        if(g_race_qualifying || g_cts)
                killtime = 0;
 
+    if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+    {
+               remove(self.killindicator);
+               self.killindicator = world;
+
+        ClientKill_Now(); // allow instant kill in this case
+        return;
+    }
+
        self.killindicator_teamchange = targetteam;
 
     if(!self.killindicator)
@@ -1381,7 +1390,7 @@ void ClientKill (void)
                ClientKill_TeamChange(0);
 }
 
-void CTS_ClientKill (entity e) // silent version of ClientKill
+void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
 {
     e.killindicator = spawn();
     e.killindicator.owner = e;