Codechange: Template script command calls.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "../../string_func.h"
|
||||
#include "../../strings_func.h"
|
||||
#include "../../tile_map.h"
|
||||
#include "../../signs_cmd.h"
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
@@ -41,7 +42,7 @@
|
||||
EnforcePreconditionEncodedText(false, text);
|
||||
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
||||
|
||||
return ScriptObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, text);
|
||||
return ScriptObject::Command<CMD_RENAME_SIGN>::Do(0, sign_id, 0, text);
|
||||
}
|
||||
|
||||
/* static */ char *ScriptSign::GetName(SignID sign_id)
|
||||
@@ -63,7 +64,7 @@
|
||||
/* static */ bool ScriptSign::RemoveSign(SignID sign_id)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidSign(sign_id));
|
||||
return ScriptObject::DoCommand(0, sign_id, 0, CMD_RENAME_SIGN, "");
|
||||
return ScriptObject::Command<CMD_RENAME_SIGN>::Do(0, sign_id, 0, "");
|
||||
}
|
||||
|
||||
/* static */ SignID ScriptSign::BuildSign(TileIndex location, Text *name)
|
||||
@@ -76,7 +77,7 @@
|
||||
EnforcePreconditionEncodedText(INVALID_SIGN, text);
|
||||
EnforcePreconditionCustomError(INVALID_SIGN, ::Utf8StringLength(text) < MAX_LENGTH_SIGN_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
|
||||
|
||||
if (!ScriptObject::DoCommand(location, 0, 0, CMD_PLACE_SIGN, text, &ScriptInstance::DoCommandReturnSignID)) return INVALID_SIGN;
|
||||
if (!ScriptObject::Command<CMD_PLACE_SIGN>::Do(&ScriptInstance::DoCommandReturnSignID, location, 0, 0, text)) return INVALID_SIGN;
|
||||
|
||||
/* In case of test-mode, we return SignID 0 */
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user