X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fnavigation.qc;h=19c0ed8e600337c22590dfda6342fb7fd91e226f;hp=7c71720c4c80ee49dfc2538093297ea65a8109d0;hb=438b49281b05c06083646754c0c25e02383d6fce;hpb=7908f6be3a5bcdb29c7fc4ca663b919ed023b1f3 diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 7c71720c4c..19c0ed8e60 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -893,7 +893,7 @@ void navigation_poptouchedgoals(entity this) } // If for some reason the bot is closer to the next goal, pop the current one - if(this.goalstack01) + if(this.goalstack01 && !wasfreed(this.goalstack01)) if(vlen2(this.goalcurrent.origin - this.origin) > vlen2(this.goalstack01.origin - this.origin)) if(checkpvs(this.origin + this.view_ofs, this.goalstack01)) if(tracewalk(this, this.origin, this.mins, this.maxs, (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5, bot_navigation_movemode)) @@ -1032,7 +1032,7 @@ void navigation_unstuck(entity this) if (!bot_waypoint_queue_owner) { - LOG_DEBUG(this.netname, " sutck, taking over the waypoints queue"); + LOG_DEBUG(this.netname, " stuck, taking over the waypoints queue"); bot_waypoint_queue_owner = this; bot_waypoint_queue_bestgoal = NULL; bot_waypoint_queue_bestgoalrating = 0; @@ -1044,7 +1044,7 @@ void navigation_unstuck(entity this) if (bot_waypoint_queue_goal) { // evaluate the next goal on the queue - float d = vlen(this.origin - bot_waypoint_queue_goal.origin); + float d = vlen2(this.origin - bot_waypoint_queue_goal.origin); LOG_DEBUG(this.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d)); if(tracewalk(bot_waypoint_queue_goal, this.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), bot_waypoint_queue_goal.origin, bot_navigation_movemode)) {