From: FruitieX Date: Wed, 8 Dec 2010 13:50:31 +0000 (+0200) Subject: fix the finish CTS kill delay X-Git-Tag: xonotic-v0.1.0preview~51^2~30 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ea659eee3578ae1e75747ec08cef69def503d2c;p=xonotic%2Fxonotic-data.pk3dir.git fix the finish CTS kill delay --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 5ff519bd7..c9cea7d21 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1263,6 +1263,11 @@ void KillIndicator_Think() ClientKill_Now(); // no oldself needed return; } + else if(g_cts) + { + self.nextthink = time + 1; + self.cnt -= 1; + } else { if(self.cnt <= 10) @@ -1297,7 +1302,13 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto self.killindicator_teamchange = targetteam; - if(!self.killindicator) + if(g_cts) // allow an instant kill in CTS + { + ClientKill_Now(); + return; + } + + else if(!self.killindicator) { if(killtime <= 0 || !self.modelindex || self.deadflag != DEAD_NO) { @@ -1355,20 +1366,14 @@ void ClientKill (void) ClientKill_TeamChange(0); } -void CTS_ClientKill_Think (void) +void CTS_ClientKill (entity e) // silent version of ClientKill { - self = self.owner; // set self to the player to be killed - sprint(self, "^1You were killed in order to prevent cheating!"); - ClientKill_Now(); -} - -void CTS_ClientKill (float t) // silent version of ClientKill -{ - entity e; - e = spawn(); - e.owner = self; - e.think = CTS_ClientKill_Think; - e.nextthink = t; + e.killindicator = spawn(); + e.killindicator.owner = e; + e.killindicator.think = KillIndicator_Think; + e.killindicator.nextthink = time + (e.lip) * 0.05; + e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay); + e.lip = 0; } void DoTeamChange(float destteam) diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 80a379aa1..dd48d7b3b 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -308,7 +308,7 @@ void race_SendTime(entity e, float cp, float t, float tvalid) race_setTime(GetMapname(), t, e.crypto_idfp, e.netname, e); if(g_cts && autocvar_g_cts_finish_kill_delay) { - CTS_ClientKill(autocvar_g_cts_finish_kill_delay); + CTS_ClientKill(e); } } if(t < recordtime || recordtime == 0) @@ -745,8 +745,13 @@ void trigger_race_checkpoint_verify() targ.wait = -2; targ.delay = 0; - setsize(targ, trigger.mins, trigger.maxs); - setorigin(targ, trigger.origin); + // These just make the game crash on some maps with oddly shaped triggers. + // (on the other hand they used to fix the case when two players ran through a checkpoint at once, + // and often one of them just passed through without being registered. Hope it's fixed in a better way now. + // (happened on item triggers too) + // + //setsize(targ, trigger.mins, trigger.maxs); + //setorigin(targ, trigger.origin); //remove(trigger); } }