]> git.tdb.fi Git - r2c2.git/commitdiff
Skip arrived trains when updating states in the route planner
authorMikko Rasa <tdb@tdb.fi>
Sat, 29 Mar 2014 15:06:52 +0000 (17:06 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 29 Mar 2014 15:06:52 +0000 (17:06 +0200)
source/libr2c2/trainrouteplanner.cpp

index 809bb3e5c665967a9a6d6d890d7eb58f582c6e15..1c7d996c5773dac66228e21be3632c31e64620a7 100644 (file)
@@ -56,6 +56,9 @@ bool TrainRoutePlanner::update_states(RoutingStep &step)
        bool changes = false;
        for(vector<TrainRoutingState>::iterator i=next.trains.begin(); i!=next.trains.end(); ++i)
        {
+               if(i->state==ARRIVED)
+                       continue;
+
                TrainState old_state = i->state;
                if(i->state==BLOCKED)
                        i->state = MOVING;