]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Speed up bot goal tracing by using vlen2 (the result is never used outside of compari...
authorMario <mario@smbclan.net>
Thu, 1 Dec 2016 13:30:45 +0000 (23:30 +1000)
committerMario <mario@smbclan.net>
Thu, 1 Dec 2016 13:30:45 +0000 (23:30 +1000)
qcsrc/server/bot/default/navigation.qc

index 7c71720c4c80ee49dfc2538093297ea65a8109d0..5092a65c664c4adcebc4753c279d386c6426cb08 100644 (file)
@@ -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))
                {