From a8cb9fa2f569ce8d6272d6a1887b17c99984a036 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 26 Dec 2008 18:24:05 +0000 Subject: (svn r14744) -Fix [FS#2474]: don't tell loading a savegame failed in two distinct ways. --- src/openttd.cpp | 25 ++++++++++--------------- src/saveload.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/openttd.cpp b/src/openttd.cpp index 3cbe953b3..b658e8944 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -799,9 +799,8 @@ static void StartScenario() /* invalid type */ if (_file_to_saveload.mode == SL_INVALID) { DEBUG(sl, 0, "Savegame is obsolete or invalid format: '%s'", _file_to_saveload.name); - SetDParam(0, STR_JUST_RAW_STRING); - SetDParamStr(1, GetSaveLoadErrorString()); - ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); + SetDParamStr(0, GetSaveLoadErrorString()); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); _game_mode = GM_MENU; return; } @@ -816,9 +815,8 @@ static void StartScenario() /* Load game */ if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, SCENARIO_DIR) != SL_OK) { LoadIntroGame(); - SetDParam(0, STR_JUST_RAW_STRING); - SetDParamStr(1, GetSaveLoadErrorString()); - ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); + SetDParamStr(0, GetSaveLoadErrorString()); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); } _settings_game.difficulty = _settings_newgame.difficulty; @@ -929,9 +927,8 @@ void SwitchMode(int new_mode) if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL, NO_DIRECTORY)) { LoadIntroGame(); - SetDParam(0, STR_JUST_RAW_STRING); - SetDParamStr(1, GetSaveLoadErrorString()); - ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); + SetDParamStr(0, GetSaveLoadErrorString()); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); } else { if (_saveload_mode == SLD_LOAD_SCENARIO) { StartupEngines(); @@ -971,9 +968,8 @@ void SwitchMode(int new_mode) SetLocalCompany(OWNER_NONE); _settings_newgame.game_creation.starting_year = _cur_year; } else { - SetDParam(0, STR_JUST_RAW_STRING); - SetDParamStr(1, GetSaveLoadErrorString()); - ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); + SetDParamStr(0, GetSaveLoadErrorString()); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); } break; } @@ -986,9 +982,8 @@ void SwitchMode(int new_mode) /* Make network saved games on pause compatible to singleplayer */ if (_networking && _pause_game == 1) _pause_game = 2; if (SaveOrLoad(_file_to_saveload.name, SL_SAVE, NO_DIRECTORY) != SL_OK) { - SetDParam(0, STR_JUST_RAW_STRING); - SetDParamStr(1, GetSaveLoadErrorString()); - ShowErrorMessage(INVALID_STRING_ID, STR_012D, 0, 0); + SetDParamStr(0, GetSaveLoadErrorString()); + ShowErrorMessage(INVALID_STRING_ID, STR_JUST_RAW_STRING, 0, 0); } else { DeleteWindowById(WC_SAVELOAD, 0); } diff --git a/src/saveload.cpp b/src/saveload.cpp index ce11d3868..06789e8b0 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -1551,7 +1551,7 @@ const char *GetSaveLoadErrorString() static void SaveFileError() { SetDParamStr(0, GetSaveLoadErrorString()); - ShowErrorMessage(STR_012D, STR_NULL, 0, 0); + ShowErrorMessage(STR_JUST_RAW_STRING, STR_NULL, 0, 0); SaveFileDone(); } @@ -1603,8 +1603,8 @@ static SaveOrLoadResult SaveFileToDisk(bool threaded) AbortSaveLoad(); if (_sl.excpt_uninit != NULL) _sl.excpt_uninit(); - ShowInfo(GetSaveLoadErrorString()); - DEBUG(sl, 0, GetSaveLoadErrorString()); + /* Skip the "color" character */ + DEBUG(sl, 0, GetSaveLoadErrorString() + 3); if (threaded) { SetAsyncSaveFinish(SaveFileError); @@ -1803,7 +1803,7 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb) if (_sl.excpt_uninit != NULL) _sl.excpt_uninit(); /* Skip the "color" character */ - ShowInfoF(GetSaveLoadErrorString() + 3); + DEBUG(sl, 0, GetSaveLoadErrorString() + 3); /* A saver/loader exception!! reinitialize all variables to prevent crash! */ return (mode == SL_LOAD) ? SL_REINIT : SL_ERROR; -- cgit v1.2.3-70-g09d2