|
@@ -290,23 +290,25 @@ enum {
|
|
|
|
|
|
/**
|
|
|
* List of flags for a command.
|
|
|
*
|
|
|
* 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.
|
|
|
DC_NO_WATER = 0x008, ///< don't allow building on water
|
|
|
DC_NO_RAIL_OVERLAP = 0x010, ///< don't allow overlap of rails (used in buildrail)
|
|
|
DC_NO_TOWN_RATING = 0x020, ///< town rating does not disallow you from building
|
|
|
DC_BANKRUPT = 0x040, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
|
|
|
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.
|
|
|
*
|
|
|
* This macro can be used to add a StringID (the error message to show) on a command-id
|
|
|
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from
|
|
@@ -358,13 +360,13 @@ enum {
|
|
|
* @param flags Flags for the command, from the DC_* enumeration
|
|
|
* @param p1 Additional data for the command
|
|
|
* @param p2 Additional data for the command
|
|
|
* @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.
|
|
|
*
|
|
|
* This struct connect a command handler function with the flags created with
|
|
|
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values.
|