summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-07-08 18:41:50 +0000
committerfrosch <frosch@openttd.org>2012-07-08 18:41:50 +0000
commit73706925d1d429d8edc74f562a2a0f3d4f1b015f (patch)
tree97b9143ca43d7858e4dea78d9d849475ca6a2f99 /src/openttd.cpp
parent8e170df609310b78221aeca16431bdcdda9c5958 (diff)
downloadopenttd-73706925d1d429d8edc74f562a2a0f3d4f1b015f.tar.xz
(svn r24388) -Fix [FS#5233]: Do not consider not finding a particular base set critical; just load a different one and display an in-game error later on.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index c11dfcf9a..602f314c9 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -725,8 +725,14 @@ int ttd_main(int argc, char *argv[])
BaseGraphics::FindSets();
if (graphics_set == NULL && BaseGraphics::ini_set != NULL) graphics_set = strdup(BaseGraphics::ini_set);
- if (!BaseGraphics::SetSet(graphics_set) && !StrEmpty(graphics_set)) {
- usererror("Failed to select requested graphics set '%s'", graphics_set);
+ if (!BaseGraphics::SetSet(graphics_set)) {
+ if (!StrEmpty(graphics_set)) {
+ BaseGraphics::SetSet(NULL);
+
+ ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_GRAPHICS_NOT_FOUND);
+ msg.SetDParamStr(0, graphics_set);
+ ScheduleErrorMessage(msg);
+ }
}
free(graphics_set);
@@ -785,18 +791,26 @@ int ttd_main(int argc, char *argv[])
BaseSounds::FindSets();
if (sounds_set == NULL && BaseSounds::ini_set != NULL) sounds_set = strdup(BaseSounds::ini_set);
if (!BaseSounds::SetSet(sounds_set)) {
- StrEmpty(sounds_set) ?
- usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of readme.txt.") :
- usererror("Failed to select requested sounds set '%s'", sounds_set);
+ if (StrEmpty(sounds_set) || !BaseSounds::SetSet(NULL)) {
+ usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of readme.txt.");
+ } else {
+ ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_SOUNDS_NOT_FOUND);
+ msg.SetDParamStr(0, sounds_set);
+ ScheduleErrorMessage(msg);
+ }
}
free(sounds_set);
BaseMusic::FindSets();
if (music_set == NULL && BaseMusic::ini_set != NULL) music_set = strdup(BaseMusic::ini_set);
if (!BaseMusic::SetSet(music_set)) {
- StrEmpty(music_set) ?
- usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of readme.txt.") :
- usererror("Failed to select requested music set '%s'", music_set);
+ if (StrEmpty(music_set) || !BaseMusic::SetSet(NULL)) {
+ usererror("Failed to find a music set. Please acquire a music set for OpenTTD. See section 4.1 of readme.txt.");
+ } else {
+ ErrorMessageData msg(STR_CONFIG_ERROR, STR_CONFIG_ERROR_INVALID_BASE_MUSIC_NOT_FOUND);
+ msg.SetDParamStr(0, music_set);
+ ScheduleErrorMessage(msg);
+ }
}
free(music_set);