Mercurial > hg > openttd
changeset 8231:7002fda5bb72 draft
(svn r11794) -Fix [FS#1632]: reversing a train when loading at a station with an adjacent station in the same axis crashed.
author | glx <glx@openttd.org> |
---|---|
date | Wed, 09 Jan 2008 17:09:53 +0000 |
parents | 5b61305fcdd4 |
children | cca79a4335e0 |
files | src/economy.cpp |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -1548,7 +1548,10 @@ return; } - if (v->type == VEH_TRAIN && !IsTileType(v->tile, MP_STATION)) { + StationID last_visited = v->last_station_visited; + Station *st = GetStation(last_visited); + + if (v->type == VEH_TRAIN && (!IsTileType(v->tile, MP_STATION) || GetStationIndex(v->tile) != st->index)) { /* The train reversed in the station. Take the "easy" way * out and let the train just leave as it always did. */ SetBit(v->vehicle_flags, VF_LOADING_FINISHED); @@ -1568,9 +1571,6 @@ v->cur_speed = 0; - StationID last_visited = v->last_station_visited; - Station *st = GetStation(last_visited); - for (; v != NULL; v = v->Next()) { if (v->cargo_cap == 0) continue;