fix zspawn timelimit check, also infect if already has been infected this round

This commit is contained in:
BotoX 2020-12-05 20:06:21 +01:00
parent a5e0f31fc1
commit 855e38cab2
1 changed files with 8 additions and 2 deletions

View File

@ -586,10 +586,10 @@ ZSpawnCondition:GetZSpawnCondition(int client)
// Check if zspawn timelimit is enabled. // Check if zspawn timelimit is enabled.
if (GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT])) if (GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT]))
{ {
new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]);
// Check if zspawn timelimit is expired. // Check if zspawn timelimit is expired.
if (!ZRIsTimerRunning(tZSpawn)) if (!ZRIsTimerRunning(tZSpawn))
{ {
new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]);
switch(zspawntimelimitzombie) switch(zspawntimelimitzombie)
{ {
case ZSpawn_Block: case ZSpawn_Block:
@ -600,7 +600,7 @@ ZSpawnCondition:GetZSpawnCondition(int client)
{ {
condition = ZSpawn_Human; condition = ZSpawn_Human;
// Client has been infected this round, respawning as a zombie. // Client has been infected this round, respawning as a zombie.
if(condition == ZSpawn_Human && g_bZSpawnClientInfected[client]) if(g_bZSpawnClientInfected[client])
condition = ZSpawn_Zombie; condition = ZSpawn_Zombie;
} }
case ZSpawn_Zombie: case ZSpawn_Zombie:
@ -609,6 +609,12 @@ ZSpawnCondition:GetZSpawnCondition(int client)
} }
} }
} }
else
{
// Client has been infected this round, respawning as a zombie.
if(condition == ZSpawn_Human && g_bZSpawnClientInfected[client])
condition = ZSpawn_Zombie;
}
} }
return condition; return condition;