summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-26 18:24:05 +0000
committerrubidium <rubidium@openttd.org>2008-12-26 18:24:05 +0000
commit634842525b28f745becad3e48e1ca77169ffe01c (patch)
tree55f6256b6da03440a89a3e0cb2c789c9e4079b40
parentc88a6199a7dfc45668da893021d072d4eac6fc5d (diff)
downloadopenttd-634842525b28f745becad3e48e1ca77169ffe01c.tar.xz
(svn r14744) -Fix [FS#2474]: don't tell loading a savegame failed in two distinct ways.
-rw-r--r--src/openttd.cpp25
-rw-r--r--src/saveload.cpp8
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;