instead of just infecting one left over we keep infecting people until hitting the required amount. We should no longer experience cases of missing main or alt candidates due to updating zombiemanager
This commit is contained in:
parent
e6304d17a0
commit
111d7a7374
@ -748,23 +748,22 @@ public Action:InfectMotherZombie(Handle:timer)
|
||||
RemoveFromArray(aCandidatesAlt, i);
|
||||
candidatesAlt--;
|
||||
}
|
||||
else // We have no candidates at all, abort!
|
||||
else // We have no candidates at all. time to fuck over random people!
|
||||
{
|
||||
/*
|
||||
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++)
|
||||
// Infect player.
|
||||
if (eligibleclients)
|
||||
{
|
||||
//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 randindex = MathGetRandomInt(0, eligibleclients - 1);
|
||||
new client = GetArrayCell(arrayEligibleClients, randindex);
|
||||
InfectHumanToZombie(client, _, true);
|
||||
break;
|
||||
if (InfectHumanToZombie(client, , true))
|
||||
{
|
||||
infected++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break; //prevent infinite loop. should be very unlikely we end up here.
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user