General: Allow auto infection on 'late' spawners.

Catch people that automatically spawn after motherzombie infection, and
make them spawn as zombies. On CSS for example you automatically spawn
if you spawn between round start and 20 seconds after, thus avoiding the
need of zspawn.
This commit is contained in:
2018-08-23 20:07:40 +02:00
parent ced7d3c352
commit a45be16399
2 changed files with 30 additions and 7 deletions

View File

@ -275,14 +275,35 @@ InfectOnClientTeam(client, team)
*/
InfectOnClientSpawn(client)
{
// Disable zombie flag on client.
g_bZombie[client] = false;
// Check if client is spawning on the terrorist team.
if (ZRIsClientOnTeam(client, CS_TEAM_T) && InfectHasZombieSpawned())
// If the zombie has spawned.
if (InfectHasZombieSpawned())
{
CS_SwitchTeam(client, CS_TEAM_CT);
CS_RespawnPlayer(client);
// Check if late spawn protection is enabled.
new bool:latespawn = GetConVarBool(g_hCvarsList[CVAR_INFECT_LATE_SPAWN]);
if (latespawn)
{
// Enable zombie flag on client.
g_bZombie[client] = true;
// Swap the client to terrorists.
if (ZRIsClientOnTeam(client, CS_TEAM_CT))
{
CS_SwitchTeam(client, CS_TEAM_T);
CS_RespawnPlayer(client);
}
}
else
{
// Disable zombie flag on client.
g_bZombie[client] = false;
// Swap the client to counter-terrorists.
if (ZRIsClientOnTeam(client, CS_TEAM_T))
{
CS_SwitchTeam(client, CS_TEAM_CT);
CS_RespawnPlayer(client);
}
}
}
InfectUnglitchKevlar(client);