From 3c141835d207df3bb5cd8b9d6d2f65b8959bcc7a Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 11 Dec 2017 18:40:04 +0100 Subject: [PATCH] Fix bug in navigation_get_really_close_waypoint --- qcsrc/server/bot/default/navigation.qc | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.2