diff options
author | fonsinchen <fonsinchen@openttd.org> | 2013-11-16 17:52:00 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2013-11-16 17:52:00 +0000 |
commit | e6668f24b508b079aa4525d06abd2ea5aa9e641d (patch) | |
tree | 1131c83af8530d3e897201e02f0d92b735988bf9 | |
parent | 6fc653d2d729d8a5c0efeba9f588e6523c3ea13d (diff) | |
download | openttd-e6668f24b508b079aa4525d06abd2ea5aa9e641d.tar.xz |
(svn r26013) -Revert (r25495) [FS#5684]: Having trains miss a platform that is just being modified is less of a problem than having trains stop twice without moving.
-rw-r--r-- | known-bugs.txt | 10 | ||||
-rw-r--r-- | src/station_cmd.cpp | 12 |
2 files changed, 17 insertions, 5 deletions
diff --git a/known-bugs.txt b/known-bugs.txt index a8591e965..36cae15aa 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -434,3 +434,13 @@ Inconsistent catchment areas [FS#5661]: search from a station could be changed to use the actual tiles, but that would require considering checking 10 by 10 tiles for each of the tiles of a station, instead of just once. + +Trains might not stop at platforms that are currently being changed [FS#5553]: + If you add tiles to or remove tiles from a platform while a train is + approaching to stop at the same platform, that train can miss the place + where it's supposed to stop and pass the station without stopping. This + is caused by the fact that the train is considered to already have stopped + if it's beyond its assigned stopping location. We can't let the train stop + just anywhere in the station because then it would never leave the station + if you have the same station in the order list multiple times in a row or + if there is only one station in the order list (see FS#5684). diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 0bed79582..6b158aaf1 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3137,11 +3137,13 @@ static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, i if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = TILE_SIZE - 1 - x; stop &= TILE_SIZE - 1; - if (x >= stop) return VETSB_ENTERED_STATION | (VehicleEnterTileStatus)(station_id << VETS_STATION_ID_OFFSET); // enter station - - v->vehstatus |= VS_TRAIN_SLOWING; - uint16 spd = max(0, (stop - x) * 20 - 15); - if (spd < v->cur_speed) v->cur_speed = spd; + if (x == stop) { + return VETSB_ENTERED_STATION | (VehicleEnterTileStatus)(station_id << VETS_STATION_ID_OFFSET); // enter station + } else if (x < stop) { + v->vehstatus |= VS_TRAIN_SLOWING; + uint16 spd = max(0, (stop - x) * 20 - 15); + if (spd < v->cur_speed) v->cur_speed = spd; + } } } else if (v->type == VEH_ROAD) { RoadVehicle *rv = RoadVehicle::From(v); |