# HG changeset patch # User smatz # Date 2008-09-16 11:19:07 # Node ID c711d8280d4436af663c5aee8d6b8f5a2dc3d1f8 # Parent a4ff3c5853f1131c1680a1591f543b1d76b57985 (svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks) diff --git a/src/openttd.cpp b/src/openttd.cpp --- 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. */