From 47d19f7914919d9a1a97aea083f49771264666bf Mon Sep 17 00:00:00 2001 From: smatz Date: Tue, 16 Sep 2008 11:19:07 +0000 Subject: (svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks) --- src/openttd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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. */ -- cgit v1.2.3-54-g00ecf