fixing endless loop happening when doing testround and alone on team

This commit is contained in:
jenz 2024-01-19 17:02:27 +01:00 committed by zaCade
parent a424ccaa39
commit 3b88ace7f5

View File

@ -698,6 +698,7 @@ public Action:InfectMotherZombie(Handle:timer)
// Infect players. // Infect players.
new infected = 0; new infected = 0;
new infected_human_to_zombie_failed = 0;
while (infected < mothercount) while (infected < mothercount)
{ {
// Infect one of the main candidates. // Infect one of the main candidates.
@ -759,6 +760,15 @@ public Action:InfectMotherZombie(Handle:timer)
{ {
infected++; infected++;
} }
else
{
infected_human_to_zombie_failed++;
if (infected_human_to_zombie_failed > 100)
{
break;
//doing testround on dev server would cause script time execution, hence this was added.
}
}
} }
else else
{ {