(svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks)
authorsmatz
Tue, 16 Sep 2008 11:19:07 +0000
changeset 10153 4d982a782aa8
parent 10152 5faa68713d8c
child 10154 5ae6e5fe6c71
(svn r14340) -Fix (r11822): signs from old savegames were lost (causing little memory leaks)
src/openttd.cpp
--- a/src/openttd.cpp	Mon Sep 15 23:50:12 2008 +0000
+++ b/src/openttd.cpp	Tue Sep 16 11:19:07 2008 +0000
@@ -1365,6 +1365,14 @@
 			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. */