summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-16 11:19:07 +0000
committersmatz <smatz@openttd.org>2008-09-16 11:19:07 +0000
commit47d19f7914919d9a1a97aea083f49771264666bf (patch)
tree81ac10729268ebb3fbfec2ead7ab212873f2ec71 /src/openttd.cpp
parentdce7bec2d33b404b81262a6f46dd4f8be10d46e6 (diff)
downloadopenttd-47d19f7914919d9a1a97aea083f49771264666bf.tar.xz
(svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks)
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index a06b0137c..23c2b81ce 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1365,6 +1365,14 @@ bool AfterLoadGame()
wp->name = CopyFromOldName(wp->string);
wp->string = STR_EMPTY;
}
+
+ for (uint i = 0; i < GetSignPoolSize(); i++) {
+ /* invalid signs are determined by si->ower == INVALID_PLAYER now */
+ Sign *si = GetSign(i);
+ if (!si->IsValid() && si->name != NULL) {
+ si->owner = OWNER_NONE;
+ }
+ }
}
/* From this point the old names array is cleared. */