From 3c24c73faa53ad6cd0ad0e19296af33e61780da2 Mon Sep 17 00:00:00 2001
From: Benau <Benau@users.noreply.github.com>
Date: Fri, 30 Sep 2016 08:15:36 +0800
Subject: [PATCH] Fix unknown sector in arena after rescue

---
 src/tracks/track_sector.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tracks/track_sector.cpp b/src/tracks/track_sector.cpp
index c6fac42c8..7959213d7 100644
--- a/src/tracks/track_sector.cpp
+++ b/src/tracks/track_sector.cpp
@@ -55,11 +55,11 @@ void TrackSector::update(const Vec3 &xyz, bool ignore_vertical)
 
     const ArenaGraph* ag = ArenaGraph::get();
     std::vector<int>* test_nodes = NULL;
-    if (ag)
+    if (ag && m_on_road && prev_sector != Graph::UNKNOWN_SECTOR)
     {
-        // For ArenaGraph, only test nodes around current node
-        if (prev_sector != Graph::UNKNOWN_SECTOR)
-            test_nodes = ag->getNode(prev_sector)->getNearbyNodes();
+        // For ArenaGraph, only test nodes around current node if previously
+        // is on road
+        test_nodes = ag->getNode(prev_sector)->getNearbyNodes();
     }
 
     Graph::get()->findRoadSector(xyz, &m_current_graph_node, test_nodes,