From 3e0a651e01ce43c3146b3a0dc6a497c547427226 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 26 Feb 2021 11:55:16 +0800 Subject: [PATCH] Fix possible infinite when broken navmesh with separated nodes --- src/tracks/arena_graph.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tracks/arena_graph.cpp b/src/tracks/arena_graph.cpp index 67d4e3818..b64743a42 100644 --- a/src/tracks/arena_graph.cpp +++ b/src/tracks/arena_graph.cpp @@ -329,6 +329,9 @@ void ArenaGraph::loadGoalNodes(const XMLNode *node) // Find all the nodes which connect the two points of // goal, notice: only work if it's a straight line first = getNextNode(first, last); + // Happens when broken navmesh with separated nodes + if (first == Graph::UNKNOWN_SECTOR) + break; first_goal ? m_blue_node.insert(first) : m_red_node.insert(first); }