]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/navigation.qc
Fix another minor bug in navigation_get_really_close_waypoint
[xonotic/xonotic-data.pk3dir.git] / 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;