From: terencehill Date: Mon, 11 Dec 2017 22:03:01 +0000 (+0100) Subject: Fix another minor bug in navigation_get_really_close_waypoint X-Git-Tag: xonotic-v0.8.5~2378^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0e22a50168f713fd1236b605caacc5b398a706a5;p=xonotic%2Fxonotic-data.pk3dir.git Fix another minor bug in navigation_get_really_close_waypoint --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 847077d69..9b9d47c9c 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1662,10 +1662,16 @@ int navigation_poptouchedgoals(entity this) entity navigation_get_really_close_waypoint(entity this) { entity wp = this.goalcurrent; - if(!wp || vdist(wp.origin - this.origin, >, 50)) + if(!wp) wp = this.goalcurrent_prev; if(!wp) return NULL; + if(wp != this.goalcurrent_prev && vdist(wp.origin - this.origin, >, 50)) + { + wp = this.goalcurrent_prev; + if(!wp) + return NULL; + } if(wp.classname != "waypoint") { wp = wp.nearestwaypoint;