]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move check for freed goals to navigation_poptouchedgoals
authorterencehill <piuntn@gmail.com>
Sun, 25 Dec 2016 09:51:14 +0000 (10:51 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 25 Dec 2016 09:51:14 +0000 (10:51 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc

index 80dc706e95643311ccc5bc8da771b86fd1c9fbca..af6aa3f2a9fba065fb3587c7c544762af9b6aeee 100644 (file)
@@ -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)
index 0e4243de6a5bfc51737d09614705e0661123c2c8..83077e1d400707a97c757599082b426bc656937c 100644 (file)
@@ -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