diff options
author | rubidium <rubidium@openttd.org> | 2009-02-09 21:20:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-09 21:20:05 +0000 |
commit | d846eef0b68474970d7ffe5f1d667d866ddff7a8 (patch) | |
tree | a4f2317ed234736c522ee05672396684eadbc141 /src/command_type.h | |
parent | cd0b38d234c7aa9f9fbfa32243e6cd66f308484a (diff) | |
download | openttd-d846eef0b68474970d7ffe5f1d667d866ddff7a8.tar.xz |
(svn r15434) -Codechange: bit of type safety for the DC_xxx flags.
Diffstat (limited to 'src/command_type.h')
-rw-r--r-- | src/command_type.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/command_type.h b/src/command_type.h index 6486aa30c..a94517563 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -293,7 +293,8 @@ enum { * * This enums defines some flags which can be used for the commands. */ -enum { +enum DoCommandFlag { + DC_NONE = 0x000, ///< no flag is set DC_EXEC = 0x001, ///< execute the given command DC_AUTO = 0x002, ///< don't allow building on structures DC_QUERY_COST = 0x004, ///< query cost only, don't build. @@ -304,6 +305,7 @@ enum { DC_AUTOREPLACE = 0x080, ///< autoreplace/autorenew is in progress, this shall disable vehicle limits when building, and ignore certain restrictions when undoing things (like vehicle attach callback) DC_ALL_TILES = 0x100, ///< allow this command also on MP_VOID tiles }; +DECLARE_ENUM_AS_BIT_SET(DoCommandFlag); /** * Used to combine a StringID with the command. @@ -361,7 +363,7 @@ enum { * @param text Additional text * @return The CommandCost of the command, which can be succeeded or failed. */ -typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text); +typedef CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text); /** * Define a command with the flags which belongs to it. |