From: terencehill Date: Wed, 9 Aug 2017 14:31:14 +0000 (+0200) Subject: Set proper destination point for 2 tracewalk calls X-Git-Tag: xonotic-v0.8.5~2378^2~89 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6f5bc44b4c79306782dc471ce05113ee6d709b31;p=xonotic%2Fxonotic-data.pk3dir.git Set proper destination point for 2 tracewalk calls --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index d54503946..756b77f01 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; }