GameLogEcho(strcat(":cts:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
-void KillIndicator_Think(entity this);
-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;
- setthink(e.killindicator, KillIndicator_Think);
- e.killindicator.nextthink = time + (e.lip) * 0.05;
- e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
- e.killindicator.count = 1; // this is used to indicate that it should be silent
- e.lip = 0;
-}
-
MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
{
entity player = M_ARGV(0, entity);
M_ARGV(1, string) = ret_string;
}
-void ClientKill_Now(entity this);
MUTATOR_HOOKFUNCTION(cts, ClientKill)
{
- entity player = M_ARGV(0, entity);
-
M_ARGV(1, float) = 0; // kill delay
-
- if(player.killindicator && player.killindicator.count == 1) // player.killindicator.count == 1 means that the kill indicator was spawned by CTS_ClientKill
- {
- delete(player.killindicator);
- player.killindicator = NULL;
-
- ClientKill_Now(player); // allow instant kill in this case
- return;
- }
}
MUTATOR_HOOKFUNCTION(cts, Race_FinalCheckpoint)
{
entity player = M_ARGV(0, entity);
+ // useful to prevent cheating by running back to the start line and starting out with more speed
if(autocvar_g_cts_finish_kill_delay)
- CTS_ClientKill(player);
+ ClientKill_Silent(player, autocvar_g_cts_finish_kill_delay);
}
MUTATOR_HOOKFUNCTION(cts, HideTeamNagger)