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 | 564aa838357a2a73eaca85ca16ff03bdc32c51f9 (patch) | |
tree | 81ac10729268ebb3fbfec2ead7ab212873f2ec71 /src | |
parent | 6d5475cb914ae4825ae98bea29317083af9a0a3b (diff) | |
download | openttd-564aa838357a2a73eaca85ca16ff03bdc32c51f9.tar.xz |
(svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks)
Diffstat (limited to 'src')
-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. */ |