nav: reworked bot dropping on pathfinder failure

This commit is contained in:
jeefo 2024-02-15 23:57:54 +03:00
commit 375a64b861
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
5 changed files with 19 additions and 12 deletions

View file

@ -816,6 +816,15 @@ void BotManager::checkBotModel (edict_t *ent, char *infobuffer) {
}
}
void BotManager::checkNeedsToBeKicked () {
for (const auto &bot : bots) {
if (bot->m_kickMeFromServer) {
bot->kick (); // kick bot from server if requested
break;
}
}
}
void BotManager::setWeaponMode (int selection) {
// this function sets bots weapon mode
@ -1659,7 +1668,7 @@ void Bot::kick (bool silent) {
// this function kick off one bot from the server.
auto username = pev->netname.chars ();
if (!(pev->flags & FL_CLIENT) || strings.isEmpty (username)) {
if (!(pev->flags & FL_CLIENT) || (pev->flags & FL_DORMANT) || strings.isEmpty (username)) {
return;
}
markStale ();