X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.cpp;h=93ebebec3c16ef66502da7045fe6df24cf429a4d;hb=a72309e64614bb1e230f9842d94dc261be1301e6;hp=00730c8e15e08fd048b35b137d51c7adcac51d91;hpb=e0a4caf7d4ef980a90cd03117705310e0469e440;p=r2c2.git diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 00730c8..93ebebe 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -583,6 +583,7 @@ void Train::tick(const Time::TimeStamp &t, const Time::TimeDelta &dt) (*i)->tick(t, dt); controller->tick(dt); float speed = controller->get_speed(); + bool moving = speed>0; if(controller->get_reverse()!=reverse) { @@ -609,7 +610,7 @@ void Train::tick(const Time::TimeStamp &t, const Time::TimeDelta &dt) speed = speed_quantizer->get_speed(current_speed_step); } - if(speed) + if(moving) { if(!active) set_active(true);