From: terencehill Date: Sun, 25 Dec 2016 09:51:14 +0000 (+0100) Subject: Move check for freed goals to navigation_poptouchedgoals X-Git-Tag: xonotic-v0.8.2~343^2~14 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=026f2155d763d70ec5addf1371c3314af2cfe36b Move check for freed goals to navigation_poptouchedgoals --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 80dc706e95..af6aa3f2a9 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -29,13 +29,6 @@ void havocbot_ai(entity this) if(bot_execute_commands(this)) return; - while(this.goalcurrent && wasfreed(this.goalcurrent)) - { - navigation_poproute(this); - if(!this.goalcurrent) - this.bot_strategytime = 0; - } - if (bot_strategytoken == this) if (!bot_strategytoken_taken) { @@ -646,8 +639,7 @@ void havocbot_movetogoal(entity this) if (this.goalcurrent == NULL) return; - if (this.goalcurrent) - navigation_poptouchedgoals(this); + navigation_poptouchedgoals(this); // if ran out of goals try to use an alternative goal or get a new strategy asap if(this.goalcurrent == NULL) diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 0e4243de6a..83077e1d40 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -876,6 +876,9 @@ void navigation_poptouchedgoals(entity this) m1 = org + this.mins; m2 = org + this.maxs; + while(this.goalcurrent && wasfreed(this.goalcurrent)) + navigation_poproute(this); + if(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT) { // make sure jumppad is really hit, don't rely on distance based checks