(svn r3294) - Fix: use INVALID_STRING_ID instead of -1.
- Fix: savegames only give back one message, show this by ignoring the first argument. Perhaps make the message more verbose in the future by adding STR_ equivalents next to the already existing debug messages.
--- a/ai/trolly/trolly.c Tue Dec 13 20:20:44 2005 +0000
+++ b/ai/trolly/trolly.c Tue Dec 13 21:21:57 2005 +0000
@@ -45,7 +45,7 @@
// We first have to init some things
if (_current_player == 1 || _ai.network_client) {
- ShowErrorMessage(-1, TEMP_AI_IN_PROGRESS, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_IN_PROGRESS, 0, 0);
}
// The PathFinder (AyStar)
--- a/command.c Tue Dec 13 20:20:44 2005 +0000
+++ b/command.c Tue Dec 13 21:21:57 2005 +0000
@@ -340,9 +340,7 @@
proc = _command_proc_table[procc].proc;
- if (_docommand_recursive == 0) {
- _error_message = INVALID_STRING_ID;
- }
+ if (_docommand_recursive == 0) _error_message = INVALID_STRING_ID;
_docommand_recursive++;
--- a/intro_gui.c Tue Dec 13 20:20:44 2005 +0000
+++ b/intro_gui.c Tue Dec 13 21:21:57 2005 +0000
@@ -88,11 +88,11 @@
case 15:
#ifdef ENABLE_NETWORK
if (!_network_available) {
- ShowErrorMessage(-1, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
} else
ShowNetworkGameWindow();
#else
- ShowErrorMessage(-1 ,STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID ,STR_NETWORK_ERR_NOTAVAILABLE, 0, 0);
#endif
break;
case 16: ShowGameOptions(); break;
--- a/openttd.c Tue Dec 13 20:20:44 2005 +0000
+++ b/openttd.c Tue Dec 13 21:21:57 2005 +0000
@@ -676,7 +676,7 @@
// invalid type
if (_file_to_saveload.mode == SL_INVALID) {
printf("Savegame is obsolete or invalid format: %s\n", _file_to_saveload.name);
- ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);
_game_mode = GM_MENU;
return;
}
@@ -692,7 +692,7 @@
// Load game
if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode) != SL_OK) {
LoadIntroGame();
- ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);
}
_opt_ptr = &_opt;
@@ -788,7 +788,7 @@
if (!SafeSaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode, GM_NORMAL)) {
LoadIntroGame();
- ShowErrorMessage(_error_message, STR_4009_GAME_LOAD_FAILED, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);
} else {
_local_player = 0;
DoCommandP(0, 0, 0, NULL, CMD_PAUSE); // decrease pause counter (was increased from opening load dialog)
--- a/saveload.c Tue Dec 13 20:20:44 2005 +0000
+++ b/saveload.c Tue Dec 13 21:21:57 2005 +0000
@@ -1356,7 +1356,7 @@
/* An instance of saving is already active, so don't go saving again */
if (_ts.saveinprogress && mode == SL_SAVE) {
// if not an autosave, but a user action, show error message
- if (!_do_autosave) ShowErrorMessage(_error_message, STR_SAVE_STILL_IN_PROGRESS, 0, 0);
+ if (!_do_autosave) ShowErrorMessage(INVALID_STRING_ID, STR_SAVE_STILL_IN_PROGRESS, 0, 0);
return SL_OK;
}
WaitTillSaved();
--- a/settings_gui.c Tue Dec 13 20:20:44 2005 +0000
+++ b/settings_gui.c Tue Dec 13 21:21:57 2005 +0000
@@ -562,13 +562,13 @@
static int32 AiNew_PatchActive_Warning(int32 p1)
{
- if (p1 == 1) ShowErrorMessage(-1, TEMP_AI_ACTIVATED, 0, 0);
+ if (p1 == 1) ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_ACTIVATED, 0, 0);
return 0;
}
static int32 Ai_In_Multiplayer_Warning(int32 p1)
{
- if (p1 == 1) ShowErrorMessage(-1, TEMP_AI_MULTIPLAYER, 0, 0);
+ if (p1 == 1) ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_MULTIPLAYER, 0, 0);
return 0;
}
@@ -617,7 +617,7 @@
}
if (!warning)
- ShowErrorMessage(-1, STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE, 0, 0);
+ ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_PATCHES_SERVICE_INTERVAL_INCOMPATIBLE, 0, 0);
return InValidateDetailsWindow(0);
}