Fix logic for FindExistingTank()

- Only create timer when > 0 tanks, after loop
- Reset any non-bots
This commit is contained in:
Jackzie 2020-10-14 12:07:47 -05:00 committed by GitHub
parent cd326fc079
commit f31219a4f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}