(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.

This commit is contained in:
rubidium
2008-10-24 20:53:57 +00:00
parent 2f48f9eee7
commit 33203c67c1
2 changed files with 5 additions and 8 deletions

View File

@@ -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);