Update openttd to 1.7.0-RC1
--HG-- branch : openttd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: script_error.cpp 26509 2014-04-25 15:40:32Z rubidium $ */
|
||||
/* $Id: script_error.cpp 27758 2017-02-26 19:41:30Z frosch $ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
@@ -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,17 +32,17 @@ 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)) {
|
||||
case 26: case 28: case 29: case 30: // NewGRF strings.
|
||||
return ERR_NEWGRF_SUPPLIED_ERROR;
|
||||
uint index = GetStringIndex(internal_string_id);
|
||||
switch (GetStringTab(internal_string_id)) {
|
||||
case TEXT_TAB_NEWGRF_START:
|
||||
case TEXT_TAB_GAMESCRIPT_START:
|
||||
return ERR_NEWGRF_SUPPLIED_ERROR; // NewGRF strings.
|
||||
|
||||
/* DO NOT SWAP case 14 and 4 because that will break StringToError due
|
||||
* to the index dependency that relies on FALL THROUGHs. */
|
||||
case 14: if (index < 0xE4) break; // Player name
|
||||
case 4: if (index < 0xC0) break; // Town name
|
||||
case 15: // Custom name
|
||||
case 31: // Dynamic strings
|
||||
case TEXT_TAB_SPECIAL:
|
||||
if (index < 0xE4) break; // Player name
|
||||
/* FALL THROUGH */
|
||||
case TEXT_TAB_TOWN:
|
||||
if (index < 0xC0) break; // Town name
|
||||
/* These strings are 'random' and have no meaning.
|
||||
* They actually shouldn't even be returned as error messages. */
|
||||
return ERR_UNKNOWN;
|
||||
|
||||
Reference in New Issue
Block a user