From 6c35c59b814526f437531797c6ae3033627dc8fb Mon Sep 17 00:00:00 2001 From: zaCade Date: Thu, 12 Oct 2017 02:18:52 +0200 Subject: [PATCH] GENERAL: Fix consecutive motherzm infections. --- src/zr/infect.inc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/zr/infect.inc b/src/zr/infect.inc index 04b47cc..4e6b29f 100644 --- a/src/zr/infect.inc +++ b/src/zr/infect.inc @@ -542,18 +542,22 @@ public Action:InfectMotherZombie(Handle:timer) // Get the client stored in the array index. new client = GetArrayCell(arrayEligibleClients, n); - // If client hasn't been chosen this cycle, put into aCandidatesMain array. - if (!SteamidCacheClientExists(g_hInfectMotherCycle, client)) + // If client hasn't been chosen last round. + if (!g_bInfectMotherLast[client]) { - PushArrayCell(aCandidatesMain, client); - candidatesMain++; - } + // If client hasn't been chosen this cycle, put into aCandidatesMain array. + if (!SteamidCacheClientExists(g_hInfectMotherCycle, client)) + { + PushArrayCell(aCandidatesMain, client); + candidatesMain++; + } - // If client hasn't been chosen last round, put into aCandidatesAlt array. - else if (!g_bInfectMotherLast[client]) - { - PushArrayCell(aCandidatesAlt, client); - candidatesAlt++; + // Else put into aCandidatesAlt array. + else + { + PushArrayCell(aCandidatesAlt, client); + candidatesAlt++; + } } } @@ -586,6 +590,7 @@ public Action:InfectMotherZombie(Handle:timer) RemoveFromArray(aCandidatesMain, i); candidatesMain--; } + // Infect one of the alternate candidates. else if (candidatesAlt) { @@ -606,6 +611,7 @@ public Action:InfectMotherZombie(Handle:timer) // Enable the cycle reset. resetcycle = true; } + // We have no candidates at all, abort! else {