From 855e38cab22615a545dec0a5b8e49c76db07c936 Mon Sep 17 00:00:00 2001 From: BotoX Date: Sat, 5 Dec 2020 20:06:21 +0100 Subject: [PATCH] fix zspawn timelimit check, also infect if already has been infected this round --- src/zr/zspawn.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/zr/zspawn.inc b/src/zr/zspawn.inc index 60d2ffc..ef94d20 100644 --- a/src/zr/zspawn.inc +++ b/src/zr/zspawn.inc @@ -586,10 +586,10 @@ ZSpawnCondition:GetZSpawnCondition(int client) // Check if zspawn timelimit is enabled. if (GetConVarBool(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT])) { + new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]); // Check if zspawn timelimit is expired. if (!ZRIsTimerRunning(tZSpawn)) { - new zspawntimelimitzombie = GetConVarInt(g_hCvarsList[CVAR_ZSPAWN_TIMELIMIT_ZOMBIE]); switch(zspawntimelimitzombie) { case ZSpawn_Block: @@ -600,7 +600,7 @@ ZSpawnCondition:GetZSpawnCondition(int client) { condition = ZSpawn_Human; // Client has been infected this round, respawning as a zombie. - if(condition == ZSpawn_Human && g_bZSpawnClientInfected[client]) + if(g_bZSpawnClientInfected[client]) condition = 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;