X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Faicontrol.cpp;h=e852858552b8120de5670d5358086d30799b6758;hb=460c64181aca1a134d74cb15ea4ad3bb4f275b60;hp=d1a69aac11f04717d10d13c4e5fea365ec8d7cba;hpb=dbaa67c30705a9993d2626cec588c7320f1eef17;p=r2c2.git diff --git a/source/libr2c2/aicontrol.cpp b/source/libr2c2/aicontrol.cpp index d1a69aa..e852858 100644 --- a/source/libr2c2/aicontrol.cpp +++ b/source/libr2c2/aicontrol.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa +Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -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)