From 7588513003b83742cbd88a5c95654ceac3427b15 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 24 Oct 2008 20:53:57 +0000 Subject: (svn r14526) -Fix [FS#2379]: make sure trains stop at the end of a station; a 3/8th length train did stop 2/8th of it's length too early causing a 63/8th long train not to fit in a 4 tile station. --- src/train_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/train_cmd.cpp') diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 527b35019..67245fe26 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4104,7 +4104,7 @@ static bool TrainApproachingLineEnd(Vehicle *v, bool signal) } /* do not reverse when approaching red signal */ - if (!signal && x + 4 >= TILE_SIZE) { + if (!signal && x + (v->u.rail.cached_veh_length + 1) / 2 >= TILE_SIZE) { /* we are too near the tile end, reverse now */ v->cur_speed = 0; ReverseTrainDirection(v); -- cgit v1.2.3-70-g09d2