diff options
author | rubidium <rubidium@openttd.org> | 2011-09-23 19:49:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-09-23 19:49:45 +0000 |
commit | 73a3708a9ecaea162cfb5e05176cdd7d37d056e9 (patch) | |
tree | 7e0b524ee0948935b5768a5bf2b9b4cf35b878b1 /src/saveload/town_sl.cpp | |
parent | a6f9488ae4285b7904755d0913a6134a95d43c28 (diff) | |
download | openttd-73a3708a9ecaea162cfb5e05176cdd7d37d056e9.tar.xz |
(svn r22958) -Fix [FS#4778]: the savegame description and loading of savegames would crash with savegames from a patched stable (which didn't bump the savegame version)
Diffstat (limited to 'src/saveload/town_sl.cpp')
-rw-r--r-- | src/saveload/town_sl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index c0b48c6ba..512c3b4c5 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -205,6 +205,10 @@ static void Load_TOWN() while ((index = SlIterateArray()) != -1) { Town *t = new (index) Town(); SlObject(t, _town_desc); + + if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST)) { + SlErrorCorrupt("Invalid town name generator"); + } } } |