X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.cpp;h=858cbbc9e8c8d093971af814a3acb049717ffc37;hb=b3f8467442aac111e9a316db0dda67d37ae240b8;hp=6ba868461b6da2eb5e995673053eada3f55a6369;hpb=81ee4fbd16b472892b67b35ea85956423a2247ed;p=r2c2.git diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 6ba8684..858cbbc 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -5,13 +5,11 @@ #include #include #include -#include "aicontrol.h" #include "beamgate.h" #include "block.h" #include "catalogue.h" #include "driver.h" #include "layout.h" -#include "route.h" #include "simplecontroller.h" #include "speedquantizer.h" #include "timetable.h" @@ -22,7 +20,6 @@ #include "trainrouter.h" #include "vehicle.h" #include "vehicletype.h" -#include "zone.h" using namespace std; using namespace Msp; @@ -301,12 +298,9 @@ void Train::tick(const Time::TimeDelta &dt) { if(stop_timeout) { - stop_timeout -= dt; + stop_timeout = max(stop_timeout-dt, Time::zero); if(stop_timeout<=Time::zero) - { allocator.set_active(false); - stop_timeout = Time::TimeDelta(); - } } travel_time += dt;