Mercurial > hg > openttd
changeset 18801:77a81ef271b0 draft
(svn r23649) -Fix [FS#4905) (r23634): loading a savegame with an empty GSTR chunk caused assert
author | truebrain <truebrain@openttd.org> |
---|---|
date | Wed, 21 Dec 2011 12:40:29 +0000 |
parents | 3db6a96d4169 |
children | 6a35af277c5e |
files | src/saveload/game_sl.cpp |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/saveload/game_sl.cpp +++ b/src/saveload/game_sl.cpp @@ -158,6 +158,13 @@ *_current_data->raw_strings.Append() = ls; } + /* If there were no strings in the savegame, set GameStrings to NULL */ + if (_current_data->raw_strings.Length() == 0) { + delete _current_data; + _current_data = NULL; + return; + } + _current_data->Compile(); ReconsiderGameScriptLanguage(); }