(svn r27754) -Codechange: Add GetStringTab(), GetStringIndex() and MakeStringID() to access the structure of StringIDs.

This commit is contained in:
frosch
2017-02-26 19:39:58 +00:00
parent b264dd2a8d
commit 9ad09627ad
7 changed files with 54 additions and 20 deletions

View File

@@ -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;