From f86223ef906cad5c492c95d069550f262f5b3dff Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 10 Apr 2014 22:49:52 +0300 Subject: [PATCH] Don't return indeterminate paths from Route::get_path Return the active path of the track instead. --- source/libr2c2/route.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libr2c2/route.cpp b/source/libr2c2/route.cpp index be4237d..5ee30e0 100644 --- a/source/libr2c2/route.cpp +++ b/source/libr2c2/route.cpp @@ -218,7 +218,7 @@ unsigned Route::get_path(Track &trk) const if(trk.get_type().is_turnout()) { map::const_iterator i = turnouts.find(trk.get_turnout_address()); - if(i!=turnouts.end()) + if(i!=turnouts.end() && i->second>=0) return i->second; } return trk.get_active_path(); -- 2.43.0