summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-06-05 20:54:52 +0000
committerglx <glx@openttd.org>2008-06-05 20:54:52 +0000
commitee256e770afb5f04a6a10f3b2045dd426d3167ff (patch)
tree62bef57de81c1ddcc691d5de5e8db395615bdacc /src/strings.cpp
parent5176319dd5145138604dd48c44b056693d900b10 (diff)
downloadopenttd-ee256e770afb5f04a6a10f3b2045dd426d3167ff.tar.xz
(svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror().
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 49df9ed66..c0d8443ed 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -178,7 +178,7 @@ static char *GetStringWithArgs(char *buffr, uint string, const int64 *argv, cons
if (index >= _langtab_num[tab]) {
error(
- "!String 0x%X is invalid. "
+ "String 0x%X is invalid. "
"Probably because an old version of the .lng file.\n", string
);
}
@@ -1427,7 +1427,7 @@ void InitializeLanguagePacks()
FioAppendDirectory(path, lengthof(path), sp, LANG_DIR);
language_count += GetLanguageList(files, language_count, lengthof(files), path);
}
- if (language_count == 0) error("No available language packs (invalid versions?)");
+ if (language_count == 0) usererror("No available language packs (invalid versions?)");
/* Acquire the locale of the current system */
const char *lang = GetCurrentLocale("LC_MESSAGES");
@@ -1463,7 +1463,7 @@ void InitializeLanguagePacks()
dl->num++;
}
- if (dl->num == 0) error("Invalid version of language packs");
+ if (dl->num == 0) usererror("Invalid version of language packs");
/* We haven't found the language in the config nor the one in the locale.
* Now we set it to one of the fallback languages */
@@ -1471,7 +1471,7 @@ void InitializeLanguagePacks()
chosen_language = (language_fallback != -1) ? language_fallback : en_GB_fallback;
}
- if (!ReadLanguagePack(chosen_language)) error("Can't read language pack '%s'", dl->ent[chosen_language].file);
+ if (!ReadLanguagePack(chosen_language)) usererror("Can't read language pack '%s'", dl->ent[chosen_language].file);
}
/**