From: Mario Date: Sat, 10 Dec 2016 06:20:22 +0000 (+0000) Subject: Merge branch 'terencehill/ca_bots_fix' into 'master' X-Git-Tag: xonotic-v0.8.2~388 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c1389c740a4a144e46543e51296ad90ade3c365b;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'terencehill/ca_bots_fix' into 'master' CA and LMS: fix for bots getting stuck * CA: fix bots getting stuck right after one of them dies * LMS: fix bots getting stuck right after one of them is out of lives * Fix "bot_cmd X pause" command not always working See merge request !389 --- c1389c740a4a144e46543e51296ad90ade3c365b diff --cc qcsrc/server/bot/default/bot.qc index 9c84a6b67,427a229fb..ed9070f9c --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@@ -632,9 -629,42 +631,42 @@@ float bot_fixcount( 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 (intermission_running) + if (gameover) return; if (time < 2)