summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-02-26 19:39:58 +0000
committerfrosch <frosch@openttd.org>2017-02-26 19:39:58 +0000
commit9ad09627ad03030d39bd07e28c74bf91b83a0f24 (patch)
tree17e9348027ce501410980cdecc1db8ac22b84a9d /src/script/api
parentb264dd2a8d71ac3fd57398e6cc23af4d5ebde046 (diff)
downloadopenttd-9ad09627ad03030d39bd07e28c74bf91b83a0f24.tar.xz
(svn r27754) -Codechange: Add GetStringTab(), GetStringIndex() and MakeStringID() to access the structure of StringIDs.
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_error.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/api/script_error.cpp b/src/script/api/script_error.cpp
index d30ad9c66..87647cfe8 100644
--- a/src/script/api/script_error.cpp
+++ b/src/script/api/script_error.cpp
@@ -13,6 +13,7 @@
#include "script_error.hpp"
#include "../../core/bitmath_func.hpp"
#include "../../string_func.h"
+#include "../../strings_func.h"
#include "../../safeguards.h"
@@ -31,8 +32,8 @@ ScriptError::ScriptErrorMapString ScriptError::error_map_string = ScriptError::S
/* static */ ScriptErrorType ScriptError::StringToError(StringID internal_string_id)
{
- uint index = GB(internal_string_id, 11, 5);
- switch (GB(internal_string_id, 11, 5)) {
+ uint index = GetStringIndex(internal_string_id);
+ switch (GetStringTab(internal_string_id)) {
case 26: case 28: case 29: case 30: // NewGRF strings.
return ERR_NEWGRF_SUPPLIED_ERROR;