|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
#pragma newdecls required
|
|
|
|
|
|
-#define PLUGIN_VERSION "1.3.6"
|
|
|
+#define PLUGIN_VERSION "1.3.7"
|
|
|
|
|
|
public Plugin myinfo = {
|
|
|
name = "[TF2] Bot Manager",
|
|
@@ -257,21 +257,19 @@ void RemoveBot() {
|
|
|
teamToKick = GetRandomInt(2, 3);
|
|
|
}
|
|
|
|
|
|
- ArrayList bots = CreateArray();
|
|
|
+ int botKickCandidates[MAXPLAYERS + 1], numBots;
|
|
|
for (int i = 1; i <= MaxClients; i++) {
|
|
|
if (IsClientConnected(i) && !IsClientSourceTV(i) && !IsClientReplay(i) &&
|
|
|
IsFakeClient(i) && GetClientTeam(i) == teamToKick) {
|
|
|
- bots.Push(i);
|
|
|
+ botKickCandidates[numBots++] = i;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!bots.Length) {
|
|
|
- delete bots;
|
|
|
+ if (!numBots) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- int bot = bots.Get(GetRandomInt(0, bots.Length - 1));
|
|
|
- delete bots;
|
|
|
+ int bot = botKickCandidates[ GetRandomInt(0, numBots - 1) ];
|
|
|
|
|
|
Call_StartForward(fwdBotKick);
|
|
|
Call_PushCellRef(bot);
|