summaryrefslogtreecommitdiff
path: root/command.h
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-04-20 22:30:40 +0000
committerDarkvater <Darkvater@openttd.org>2005-04-20 22:30:40 +0000
commitb12c73b0505020fd5e8d4fb9d7164960f4fabfbe (patch)
tree9bd856412b1a7502fb5d633a0224a25fe0161633 /command.h
parent6e4f1b5a4bbbfa2dbc37a052822ce33f8782ab9b (diff)
downloadopenttd-b12c73b0505020fd5e8d4fb9d7164960f4fabfbe.tar.xz
(svn r2217) - Fix: [ 1184201 ] AI orders its vehicles to a competitor's truck stop. Added a CmdFailed() check to all command returns of the AI instead of the simple == / != CMD_ERROR check. This should fix the problem.
Diffstat (limited to 'command.h')
-rw-r--r--command.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/command.h b/command.h
index 16ececd50..030bda50f 100644
--- a/command.h
+++ b/command.h
@@ -177,6 +177,11 @@ enum {
//#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0)
#define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0)
+/**
+ * Check the return value of a DoCommand*() function
+ * @param res the resulting value from the command to be checked
+ * @return Return true if the command failed, false otherwise
+ */
static inline bool CmdFailed(int32 res)
{
// lower 16bits are the StringID of the possible error