From d7045045a68a8e0f187448274e226dea687ef38d Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sun, 12 Dec 2010 14:26:20 +0200 Subject: [PATCH] explicitly allow an instant kill after player finished a CTS run, add a comment --- qcsrc/server/cl_client.qc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index ba6c2e578..707d36ede 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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; -- 2.39.2