From 0e22a50168f713fd1236b605caacc5b398a706a5 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 11 Dec 2017 23:03:01 +0100 Subject: [PATCH] Fix another minor bug in navigation_get_really_close_waypoint --- qcsrc/server/bot/default/navigation.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.2