Avoid possible infinite loop
This commit is contained in:
parent
0134e9c664
commit
35463a12da
@ -317,6 +317,11 @@ void ArenaGraph::loadGoalNodes(const XMLNode *node)
|
||||
int last = Graph::UNKNOWN_SECTOR;
|
||||
findRoadSector(p2, &last, NULL, true);
|
||||
|
||||
// Avoid possible infinite loop
|
||||
if (first == Graph::UNKNOWN_SECTOR ||
|
||||
last == Graph::UNKNOWN_SECTOR)
|
||||
continue;
|
||||
|
||||
first_goal ? m_blue_node.insert(first) : m_red_node.insert(first);
|
||||
first_goal ? m_blue_node.insert(last) : m_red_node.insert(last);
|
||||
while (first != last)
|
||||
|
Loading…
Reference in New Issue
Block a user