summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-01 06:15:26 +0000
committerrubidium <rubidium@openttd.org>2010-09-01 06:15:26 +0000
commitdd2c38ea82df715422c1f62ee71dcd48b3c41cd7 (patch)
tree0743ba8837b67d217c137f0554179b6401bf1758 /src/saveload
parentb610b1af616f1c2ca4e16a7cbee27b46c6534eb8 (diff)
downloadopenttd-dd2c38ea82df715422c1f62ee71dcd48b3c41cd7.tar.xz
(svn r20708) -Fix [FS#4101]: upon company bankruptcy some objects weren't removed properly
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/object_sl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/saveload/object_sl.cpp b/src/saveload/object_sl.cpp
index 586c12a33..b1e2200cd 100644
--- a/src/saveload/object_sl.cpp
+++ b/src/saveload/object_sl.cpp
@@ -52,7 +52,12 @@ static void Ptrs_OBJS()
Object *o;
FOR_ALL_OBJECTS(o) {
SlObject(o, _object_desc);
- Object::IncTypeCount(GetObjectType(o->location.tile));
+ if (CheckSavegameVersion(148) && !IsTileType(o->location.tile, MP_OBJECT)) {
+ /* Due to a small bug stale objects could remain. */
+ delete o;
+ } else {
+ Object::IncTypeCount(GetObjectType(o->location.tile));
+ }
}
}