From: terencehill Date: Mon, 11 Dec 2017 17:40:04 +0000 (+0100) Subject: Fix bug in navigation_get_really_close_waypoint X-Git-Tag: xonotic-v0.8.5~2378^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c141835d207df3bb5cd8b9d6d2f65b8959bcc7a;p=xonotic%2Fxonotic-data.pk3dir.git Fix bug in navigation_get_really_close_waypoint --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 356c04b17..847077d69 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -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;