From 93d0294e57201226ce5b7c6df65e7d8512594c2d Mon Sep 17 00:00:00 2001
From: Mario <mario@smbclan.net>
Date: Thu, 1 Dec 2016 23:30:45 +1000
Subject: [PATCH] Speed up bot goal tracing by using vlen2 (the result is never
 used outside of comparisons with itself)

---
 qcsrc/server/bot/default/navigation.qc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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))
 		{
-- 
2.39.5