summaryrefslogtreecommitdiff
path: root/src/command_func.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-01-12 15:27:39 +0000
committerfrosch <frosch@openttd.org>2009-01-12 15:27:39 +0000
commit508fc292219a07717b2b8449fbb5a11e02ddef83 (patch)
tree1531a0dd531eb511b9d2669071bcd3747f09a65c /src/command_func.h
parent809bf8fb437885222404ec328ce44576e321a013 (diff)
downloadopenttd-508fc292219a07717b2b8449fbb5a11e02ddef83.tar.xz
(svn r15014) -Codechange: Add a helper function to get the needed DC_xxx flags from the result of GetCommandFlags().
Diffstat (limited to 'src/command_func.h')
-rw-r--r--src/command_func.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/command_func.h b/src/command_func.h
index 1b8af25b9..a6b77c6a0 100644
--- a/src/command_func.h
+++ b/src/command_func.h
@@ -86,4 +86,17 @@ byte GetCommandFlags(uint32 cmd);
*/
Money GetAvailableMoneyForCommand();
+/**
+ * Extracts the DC flags needed for DoCommand from the flags returned by GetCommandFlags
+ * @param cmd_flags Flags from GetCommandFlags
+ * @return flags for DoCommand
+ */
+static inline uint32 CommandFlagsToDCFlags(uint cmd_flags)
+{
+ uint32 flags = 0;
+ if (cmd_flags & CMD_NO_WATER) flags |= DC_NO_WATER;
+ if (cmd_flags & CMD_AUTO) flags |= DC_AUTO;
+ return flags;
+}
+
#endif /* COMMAND_FUNC_H */