]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
If for some reason final goal was removed clear route instead of simply removing it
authorterencehill <piuntn@gmail.com>
Wed, 15 Feb 2017 15:15:03 +0000 (16:15 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 15 Feb 2017 15:15:03 +0000 (16:15 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/bot/default/navigation.qc

index ba8757502bc5afe21e8f09832ddd3a1ff7cac9f7..3d4e298d13fe6196ab4784a297f677a62795faf3 100644 (file)
@@ -676,7 +676,13 @@ void havocbot_movetogoal(entity this)
 
 
        bool locked_goal = false;
-       if(this.goalentity.bot_pickup)
+       if(this.goalentity && wasfreed(this.goalentity))
+       {
+               navigation_clearroute(this);
+               this.bot_strategytime = 0;
+               return;
+       }
+       else if(this.goalentity.bot_pickup)
        {
                if(this.goalentity.bot_pickup_respawning)
                {
index 95d787e002f2f1e40d57bf40d4b8f8d3a999f5cd..0883bacd02725bd72faed7c6af2702ee5e742a8b 100644 (file)
@@ -927,9 +927,6 @@ 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