From 6f5bc44b4c79306782dc471ce05113ee6d709b31 Mon Sep 17 00:00:00 2001
From: terencehill <piuntn@gmail.com>
Date: Wed, 9 Aug 2017 16:31:14 +0200
Subject: [PATCH] Set proper destination point for 2 tracewalk calls

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

diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc
index d545039468..756b77f012 100644
--- a/qcsrc/server/bot/default/navigation.qc
+++ b/qcsrc/server/bot/default/navigation.qc
@@ -1262,9 +1262,9 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
 		return true;
 
 	// if it can reach the goal there is nothing more to do
-	vector dest = (e.absmin + e.absmax) * 0.5;
-	dest.z = e.absmin.z;
-	float dest_height = e.absmax.z - e.absmin.z;
+	vector dest;
+	float dest_height;
+	SET_TRACEWALK_DESTCOORDS(e, e.origin, dest, dest_height);
 	if (tracewalk(this, startposition, STAT(PL_MIN, this), STAT(PL_MAX, this), dest, dest_height, bot_navigation_movemode))
 		return true;
 
@@ -1290,9 +1290,7 @@ bool navigation_routetogoal(entity this, entity e, vector startposition)
 		{
 			if (this.goalentity.navigation_dynamicgoal)
 			{
-				vector dest = (this.goalentity.absmin + this.goalentity.absmax) * 0.5;
-				dest.z = this.goalentity.absmin.z;
-				float dest_height = this.goalentity.absmax.z - this.goalentity.absmin.z;
+				SET_TRACEWALK_DESTCOORDS(e, e.origin, dest, dest_height);
 				if(tracewalk(this, nearest_wp.enemy.origin, STAT(PL_MIN, this), STAT(PL_MAX, this), dest, dest_height, bot_navigation_movemode))
 					e = nearest_wp.enemy;
 			}
-- 
2.39.5