summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-23 19:43:09 +0000
committersmatz <smatz@openttd.org>2009-05-23 19:43:09 +0000
commit7854e68b95951979445bb485f1d377a358c6d204 (patch)
tree287bcea15d830067e7e4fcd842388e7c0151a1b6 /src/saveload
parent4bf70602a116f957ffdbb599d0de6f92a7df0a28 (diff)
downloadopenttd-7854e68b95951979445bb485f1d377a358c6d204.tar.xz
(svn r16407) -Fix [FS#2913]: set CargoPacket::source to INVALID_STATION when source station is deleted
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index bc3aa436a..d55b821e3 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -1275,6 +1275,14 @@ bool AfterLoadGame()
}
}
+ if (CheckSavegameVersion(120)) {
+ /* CargoPacket's source should be either INVALID_STATION or a valid station */
+ CargoPacket *cp;
+ FOR_ALL_CARGOPACKETS(cp) {
+ if (!Station::IsValidID(cp->source)) cp->source = INVALID_STATION;
+ }
+ }
+
/* Buoys do now store the owner of the previous water tile, which can never
* be OWNER_NONE. So replace OWNER_NONE with OWNER_WATER. */
if (CheckSavegameVersion(46)) {