when there is max 1 mother zombie to be infected we sometimes have rounds with no mother zombies, this instead just picks one client randomly

This commit is contained in:
jenz 2023-09-11 19:31:40 +02:00 committed by zaCade
parent c2c97051fc
commit e6304d17a0

View File

@ -750,6 +750,20 @@ public Action:InfectMotherZombie(Handle:timer)
}
else // We have no candidates at all, abort!
{
/*
ghostie complained about how we often dont have a mother zombie when its a low playercount. we just need to infect one guy on
these rounds, stuff like ZombieManager and PlayerRanking (topdefender) interfere with people who can be infected.
Sometimes when only one mother zombie should spawn we end up with rounds that dont have any mother zombie at all
despite having human clients who play. 2023 11th september.
*/
for (new n = 0; n < eligibleclients; n++)
{
//we just pick a random client here inside of the loop because it ensures that at least one client exists.
new randindex = Math_GetRandomInt(0, eligibleclients - 1);
new client = GetArrayCell(arrayEligibleClients, randindex);
InfectHumanToZombie(client, _, true);
break;
}
break;
}
}