From: Mikko Rasa Date: Fri, 20 Feb 2015 16:40:54 +0000 (+0200) Subject: Clear the critical flag one track earlier X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2d9b73acd9653686eb5d9b7e919848895051ab0d;p=r2c2.git Clear the critical flag one track earlier Check_arrival is called when the train reaches the end of its current track. The flag should be cleared when the track it is entering is no longer critical. --- diff --git a/source/libr2c2/trainrouteplanner.cpp b/source/libr2c2/trainrouteplanner.cpp index b6d2f07..0140f43 100644 --- a/source/libr2c2/trainrouteplanner.cpp +++ b/source/libr2c2/trainrouteplanner.cpp @@ -375,7 +375,7 @@ bool TrainRoutePlanner::TrainRoutingState::check_arrival() } } - if(info->first_noncritical->has_track(*track)) + if(info->first_noncritical->has_track(*next_track)) critical = false; return false;