From 1efb7d0debe9e6e9b480eb16381c1b90d0fb7d17 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 19 Feb 2011 06:45:28 +0000 Subject: [PATCH] Copy speed only if the preceding train is active --- source/libr2c2/aicontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.45.2