]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix another minor bug in navigation_get_really_close_waypoint
authorterencehill <piuntn@gmail.com>
Mon, 11 Dec 2017 22:03:01 +0000 (23:03 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 11 Dec 2017 22:03:01 +0000 (23:03 +0100)
qcsrc/server/bot/default/navigation.qc

index 847077d695a63b07ec78d41091e49cbace328784..9b9d47c9c5a5c5094efdafb235ecb8ddfc3a09ad 100644 (file)
@@ -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;