From e6304d17a050decdcec34770f38308885d2f6ff0 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 11 Sep 2023 19:31:40 +0200 Subject: [PATCH] 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 --- src/zr/infect.inc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/zr/infect.inc b/src/zr/infect.inc index 23a4bc4..06fd9e5 100644 --- a/src/zr/infect.inc +++ b/src/zr/infect.inc @@ -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; } }