summaryrefslogtreecommitdiff
path: root/src/command_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-11 20:21:56 +0000
committerrubidium <rubidium@openttd.org>2010-01-11 20:21:56 +0000
commit3e5a87a52cc8355a2a5c2831c60643bf30d41a3a (patch)
tree87420f35edef10eaeb6bffbb5604c865beb9076d /src/command_type.h
parent6a047d2316dc49a8e75f14a0e73c59d1d55c568c (diff)
downloadopenttd-3e5a87a52cc8355a2a5c2831c60643bf30d41a3a.tar.xz
(svn r18783) -Codechange: make CheckCompanyHasMoney set an error on the CommandCost it tests when you don't have enough money instead of setting a global variable.
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
*/