From: Mario Date: Thu, 1 Dec 2016 13:30:45 +0000 (+1000) Subject: Speed up bot goal tracing by using vlen2 (the result is never used outside of compari... X-Git-Tag: xonotic-v0.8.2~403 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=93d0294e57201226ce5b7c6df65e7d8512594c2d;p=xonotic%2Fxonotic-data.pk3dir.git Speed up bot goal tracing by using vlen2 (the result is never used outside of comparisons with itself) --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 7c71720c4..5092a65c6 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -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)) {