Revert "General: Allow auto infection on 'late' spawners."

This reverts commit a45be16399.
This commit is contained in:
zaCade 2018-08-28 13:22:54 +02:00
parent a45be16399
commit 252392c433
2 changed files with 7 additions and 30 deletions

View File

@ -107,7 +107,6 @@ enum CvarsList
Handle:CVAR_INFECT_WEAPONS_DROP,
Handle:CVAR_INFECT_KNIFE_COOLDOWN,
Handle:CVAR_INFECT_MAX_DISTANCE,
Handle:CVAR_INFECT_LATE_SPAWN,
Handle:CVAR_INFECT_MZOMBIE_MODE,
Handle:CVAR_INFECT_MZOMBIE_RATIO,
Handle:CVAR_INFECT_MZOMBIE_MIN,
@ -336,7 +335,6 @@ CvarsCreate()
g_hCvarsList[CVAR_INFECT_WEAPONS_DROP] = CreateConVar("zr_infect_weapons_drop", "1", "Force player to drop all weapons on infect, disabling this will strip weapons instead.");
g_hCvarsList[CVAR_INFECT_KNIFE_COOLDOWN] = CreateConVar("zr_infect_knife_cooldown", "1.0", "Time in seconds during which knife can not be used after becoming a zombie.");
g_hCvarsList[CVAR_INFECT_MAX_DISTANCE] = CreateConVar("zr_infect_max_distance", "80.0", "The maximum allowed distance between a client and an attacker for a successful infection. [0.0 = Disabled]");
g_hCvarsList[CVAR_INFECT_LATE_SPAWN] = CreateConVar("zr_infect_late_spawn", "0", "Should people spawning after mother infection also be infected, or should nothing happen. [0.0 = Disabled]");
// Effects
g_hCvarsList[CVAR_INFECT_EXPLOSION] = CreateConVar("zr_infect_explosion", "1", "Disabling this will disable the fireball, smoke cloud, and sparks in a more efficient way.");

View File

@ -275,35 +275,14 @@ InfectOnClientTeam(client, team)
*/
InfectOnClientSpawn(client)
{
// If the zombie has spawned.
if (InfectHasZombieSpawned())
// 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())
{
// 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);
}
}
CS_SwitchTeam(client, CS_TEAM_CT);
CS_RespawnPlayer(client);
}
InfectUnglitchKevlar(client);