X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Faicontrol.cpp;h=59126d8505b193cafea380401b5c7db0edf3ffc4;hb=1efb7d0debe9e6e9b480eb16381c1b90d0fb7d17;hp=d1a69aac11f04717d10d13c4e5fea365ec8d7cba;hpb=598631d530a20ba8f4710f45747a9742e149f604;p=r2c2.git diff --git a/source/libr2c2/aicontrol.cpp b/source/libr2c2/aicontrol.cpp index d1a69aa..59126d8 100644 --- a/source/libr2c2/aicontrol.cpp +++ b/source/libr2c2/aicontrol.cpp @@ -124,7 +124,7 @@ void AIControl::tick(const Time::TimeDelta &dt) speed_limit = 0; else if(state==APPROACH) speed_limit = approach_speed; - else if(state==FOLLOW) + else if(state==FOLLOW && train.get_preceding_train()->is_active()) speed_limit = train.get_preceding_train()->get_speed(); if(speed_limit>=0 && target_speed.value>speed_limit)