diff options
author | smatz <smatz@openttd.org> | 2009-01-18 16:20:04 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-01-18 16:20:04 +0000 |
commit | 52e0c6fd359283b2da89a2566c105cf2ebff5864 (patch) | |
tree | 37c973887ee481b7ae9fa97c49d8eeceba2ff131 /src/saveload/signs_sl.cpp | |
parent | d793439f4304bc8eb6806827962b838d489e2f26 (diff) | |
download | openttd-52e0c6fd359283b2da89a2566c105cf2ebff5864.tar.xz |
(svn r15137) -Fix (r11822)(r14340): signs with sign 'Sign' were lost when converting from TTD savegames
Diffstat (limited to 'src/saveload/signs_sl.cpp')
-rw-r--r-- | src/saveload/signs_sl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/saveload/signs_sl.cpp b/src/saveload/signs_sl.cpp index ef4530dcd..7dbb9e355 100644 --- a/src/saveload/signs_sl.cpp +++ b/src/saveload/signs_sl.cpp @@ -41,6 +41,15 @@ static void Load_SIGN() while ((index = SlIterateArray()) != -1) { Sign *si = new (index) Sign(); SlObject(si, _sign_desc); + /* Before version 6.1, signs didn't have owner. + * Before version 83, invalid signs were determined by si->str == 0. + * Before version 103, owner could be a bankrupted company. + * - we can't use IsValidCompany() now, so this is fixed in AfterLoadGame() + * All signs that were saved are valid (including those with just 'Sign' and INVALID_OWNER). + * - so set owner to OWNER_NONE if needed (signs from pre-version 6.1 would be lost) */ + if (CheckSavegameVersionOldStyle(6, 1) || (CheckSavegameVersion(83) && si->owner == INVALID_OWNER)) { + si->owner = OWNER_NONE; + } } } |