From: Mikko Rasa Date: Fri, 13 Feb 2015 00:50:36 +0000 (+0200) Subject: Don't eat away departure delay while halted X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=066170fbc56bb5bd33a5ce0b9b7b668a3f539ee6;p=r2c2.git Don't eat away departure delay while halted --- diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index a5a63b4..4a5c2bb 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -1,3 +1,4 @@ +#include "driver.h" #include "layout.h" #include "route.h" #include "trackiter.h" @@ -225,24 +226,27 @@ void TrainRouter::message(const Message &msg) void TrainRouter::tick(const Time::TimeDelta &dt) { - if(delay) - { - delay -= dt; - if(delaycheck()!=TrainRoutePlanner::PENDING) apply_plan(train.get_layout(), *planner); + if(!train.get_layout().get_driver().is_halted()) + { + if(delay) + { + delay -= dt; + if(delay