diff options
author | Darkvater <darkvater@openttd.org> | 2005-04-20 22:30:40 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-04-20 22:30:40 +0000 |
commit | c8f07a2dd968bdec784a352689091a7692b24849 (patch) | |
tree | 9bd856412b1a7502fb5d633a0224a25fe0161633 /command.h | |
parent | 1b312083fcbfc73bb80eac6693ff1a4fd7c7d1e0 (diff) | |
download | openttd-c8f07a2dd968bdec784a352689091a7692b24849.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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |