From f31219a4f6f5bd6295562952d4d4f0d53ea574c8 Mon Sep 17 00:00:00 2001 From: Jackz Date: Wed, 14 Oct 2020 12:07:47 -0500 Subject: [PATCH] Fix logic for FindExistingTank() - Only create timer when > 0 tanks, after loop - Reset any non-bots --- scripting/200IQBots_FlyYouFools.sp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripting/200IQBots_FlyYouFools.sp b/scripting/200IQBots_FlyYouFools.sp index bd0dd47..33cabfb 100644 --- a/scripting/200IQBots_FlyYouFools.sp +++ b/scripting/200IQBots_FlyYouFools.sp @@ -154,14 +154,17 @@ public void FindExistingTank() { if(StrContains(name, "Tank", true) > -1) { bIsTank[i] = true; PrintToChatAll("Found existing tank: %N (%i)", i, i); - if(iAliveTanks == 0) { - CreateTimer(0.1, BotControlTimerV2, _, TIMER_REPEAT); - } + iAliveTanks++; + continue; } } + bIsTank[i] = false; } + if(iAliveTanks > 0) { + CreateTimer(0.1, BotControlTimerV2, _, TIMER_REPEAT); + } } //Credits to Timocop for the stock :D @@ -215,4 +218,4 @@ stock bool GetItemSlotClassName(int client, int slot, char[] buffer, int bufferS }else{ return false; } -} \ No newline at end of file +}