From: Mikko Rasa Date: Thu, 10 Apr 2014 19:49:52 +0000 (+0300) Subject: Don't return indeterminate paths from Route::get_path X-Git-Url: http://git.tdb.fi/?p=r2c2.git;a=commitdiff_plain;h=f86223ef906cad5c492c95d069550f262f5b3dff Don't return indeterminate paths from Route::get_path Return the active path of the track instead. --- 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();