]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bug in navigation_get_really_close_waypoint
authorterencehill <piuntn@gmail.com>
Mon, 11 Dec 2017 17:40:04 +0000 (18:40 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 11 Dec 2017 17:40:04 +0000 (18:40 +0100)
qcsrc/server/bot/default/navigation.qc

index 356c04b17ba6c4ef30230f0e82ba35997419c378..847077d695a63b07ec78d41091e49cbace328784 100644 (file)
@@ -1674,6 +1674,7 @@ entity navigation_get_really_close_waypoint(entity this)
        }
        if(vdist(wp.origin - this.origin, >, 50))
        {
+               wp = NULL;
                IL_EACH(g_waypoints, !(it.wpflags & WAYPOINTFLAG_TELEPORT),
                {
                        if(vdist(it.origin - this.origin, <, 50))
@@ -1682,6 +1683,8 @@ entity navigation_get_really_close_waypoint(entity this)
                                break;
                        }
                });
+               if(!wp)
+                       return NULL;
        }
        if(wp.wpflags & WAYPOINTFLAG_TELEPORT)
                return NULL;