bool bot_fixcount();
void bot_list_commands();
void bot_queuecommand(entity bot, string cmdstring);
+void bot_clear(entity this);
void bot_relinkplayerlist();
void bot_resetqueues();
void bot_serverframe();
void bot_endgame()
{
- entity e;
- //dprint("bot_endgame\n");
- e = bot_list;
+ bot_relinkplayerlist();
+ entity e = bot_list;
while (e)
{
setcolor(e, e.bot_preferredcolors);
this.playerskin_freeme = string_null;
if(this.bot_cmd_current)
delete(this.bot_cmd_current);
- if(bot_waypoint_queue_owner==this)
+ if(bot_waypoint_queue_owner == this)
bot_waypoint_queue_owner = NULL;
}
return true;
}
+void bot_remove_from_bot_list(entity this)
+{
+ entity e = bot_list;
+ entity prev_bot = NULL;
+ while (e)
+ {
+ if(e == this)
+ {
+ if(!prev_bot)
+ bot_list = this.nextbot;
+ else
+ prev_bot.nextbot = this.nextbot;
+ if(bot_strategytoken == this)
+ {
+ bot_strategytoken = this.nextbot;
+ bot_strategytoken_taken = true;
+ }
+ this.nextbot = NULL;
+ break;
+ }
+ prev_bot = e;
+ e = e.nextbot;
+ }
+}
+
+void bot_clear(entity this)
+{
+ bot_remove_from_bot_list(this);
+ if(bot_waypoint_queue_owner == this)
+ bot_waypoint_queue_owner = NULL;
+ this.aistatus &= ~AI_STATUS_STUCK; // otherwise bot_waypoint_queue_owner will be set again to this by navigation_unstuck
+}
+
void bot_serverframe()
{
if (gameover)
void bot_custom_weapon_priority_setup();
void bot_endgame();
void bot_relinkplayerlist();
+void bot_clear(entity this);
void bot_clientdisconnect(entity this);
void bot_clientconnect(entity this);
void bot_removefromlargestteam();
float bot_cmd_continue(entity this)
{
+ bot_relinkplayerlist();
this.bot_exec_status &= ~BOT_EXEC_STATUS_PAUSED;
return CMD_STATUS_FINISHED;
}
this.movement = '0 0 0';
this.bot_cmd_keys = BOT_CMD_KEY_NONE;
+ bot_clear(this);
this.bot_exec_status |= BOT_EXEC_STATUS_PAUSED;
return CMD_STATUS_FINISHED;
}
PutClientInServer(it);
}
});
+ bot_relinkplayerlist();
return true;
}
frag_target.respawn_flags = RESPAWN_SILENT;
if (!warmup_stage)
eliminatedPlayers.SendFlags |= 1;
+ if(IS_BOT_CLIENT(frag_target))
+ bot_clear(frag_target);
return true;
}
FOREACH_CLIENT(IS_PLAYER(it), { pl_cnt++; });
if (player.lms_spectate_warning != 2)
{
+ if(IS_BOT_CLIENT(player))
+ bot_clear(player);
player.frags = FRAGS_LMS_LOSER;
PlayerScore_Add(player, SP_LMS_RANK, pl_cnt + 1);
}
{
int pl_cnt = 0;
FOREACH_CLIENT(IS_PLAYER(it), { pl_cnt++; });
+ if(IS_BOT_CLIENT(frag_target))
+ bot_clear(frag_target);
frag_target.frags = FRAGS_LMS_LOSER;
PlayerScore_Add(frag_target, SP_LMS_RANK, pl_cnt);
}