From 6cab3b07c93702231b49a5a0b00076606f4a9773 Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 8 Jul 2019 10:18:50 +0800 Subject: [PATCH] Avoid crashing in TrackSector if findOutOfRoadSector failed --- src/tracks/graph.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tracks/graph.cpp b/src/tracks/graph.cpp index be0da2f9e..789ae1d74 100644 --- a/src/tracks/graph.cpp +++ b/src/tracks/graph.cpp @@ -757,9 +757,10 @@ int Graph::findOutOfRoadSector(const Vec3& xyz, const int curr_sector, if(min_sector==UNKNOWN_SECTOR) { - Log::info("Graph", "unknown sector found."); + Log::warn("Graph", "unknown sector found."); } - return min_sector; + // Avoid crashing in TrackSector + return 0; } // findOutOfRoadSector //-----------------------------------------------------------------------------