summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-01-16 18:31:58 +0000
committerrubidium <rubidium@openttd.org>2007-01-16 18:31:58 +0000
commitf9c6f7d0a75a4fc41cdfca2eb7afda1291858191 (patch)
tree20cce5f3a9cb7995c8e02a5d09802ff754d4ff8a
parent1770db53cae0eedb1eb97b63df120696a8186341 (diff)
downloadopenttd-f9c6f7d0a75a4fc41cdfca2eb7afda1291858191.tar.xz
(svn r8161) -Fix (FS#555, r8144): enroute_from_xy was not set properly for old savegames.
-rw-r--r--src/station_cmd.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 864ddd873..36ec79d12 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3011,6 +3011,13 @@ static void SaveLoad_STNS(Station *st)
if (CheckSavegameVersion(7) && st->goods[i].enroute_from == 0xFF) {
st->goods[i].enroute_from = INVALID_STATION;
}
+ if (CheckSavegameVersion(44)) {
+ /* Store position of the station where the goods come from, so there are no
+ * very high payments when stations get removed. However, if the station
+ * where the goods came from is already removed, the source information is
+ * lost. In that case we set it to the position of this station */
+ st->goods[i].enroute_from_xy = IsValidStationID(st->goods[i].enroute_from) ? GetStation(st->goods[i].enroute_from)->xy : st->xy;
+ }
}
if (st->num_specs != 0) {