diff options
author | smatz <smatz@openttd.org> | 2008-09-16 11:19:07 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-09-16 11:19:07 +0000 |
commit | 47d19f7914919d9a1a97aea083f49771264666bf (patch) | |
tree | 81ac10729268ebb3fbfec2ead7ab212873f2ec71 | |
parent | dce7bec2d33b404b81262a6f46dd4f8be10d46e6 (diff) | |
download | openttd-47d19f7914919d9a1a97aea083f49771264666bf.tar.xz |
(svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks)
-rw-r--r-- | src/openttd.cpp | 8 |
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. */ |