ClientKill_Now(); // no oldself needed
return;
}
+ else if(g_cts)
+ {
+ self.nextthink = time + 1;
+ self.cnt -= 1;
+ }
else
{
if(self.cnt <= 10)
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)
{
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)
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)
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);
}
}