diff options
author | rubidium <rubidium@openttd.org> | 2009-04-13 22:27:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-04-13 22:27:21 +0000 |
commit | 34cc30e7fb7060185a92d15f9d68136ba64a8efd (patch) | |
tree | a77a3ec5e295724d4cc38034c6360576f85876e6 /src/station_cmd.cpp | |
parent | 627c042df10f8a7cc8169683713881cff248c1a5 (diff) | |
download | openttd-34cc30e7fb7060185a92d15f9d68136ba64a8efd.tar.xz |
(svn r16057) -Fix [FS#2834] (r16037): division by zero when having an order with only one station that has either middle or near end stop location and where the platform is (significantly) longer than the train.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 563c440a9..91a7c73f0 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2681,7 +2681,7 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i * begin of the platform to the stop location is longer than the length * of the platform. Station ahead 'includes' the current tile where the * vehicle is on, so we need to substract that. */ - if (station_length <= stop + station_ahead - TILE_SIZE) return VETSB_CONTINUE; + if (!IsInsideBS(stop + station_ahead, station_length, TILE_SIZE)) return VETSB_CONTINUE; DiagDirection dir = DirToDiagDir(v->direction); |