summaryrefslogtreecommitdiff
path: root/src/command_type.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_type.h')
-rw-r--r--src/command_type.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/command_type.h b/src/command_type.h
index 0bff05003..42e622025 100644
--- a/src/command_type.h
+++ b/src/command_type.h
@@ -108,6 +108,17 @@ public:
}
/**
+ * Makes this CommandCost behave like an error command.
+ * @param mesasge the error message.
+ */
+ void MakeError(StringID message)
+ {
+ assert(message != INVALID_STRING_ID);
+ this->success = false;
+ this->message = message;
+ }
+
+ /**
* Returns the error message of a command
* @return the error message, if succeeded INVALID_STRING_ID
*/