equal
deleted
inserted
replaced
175 }; |
175 }; |
176 |
176 |
177 //#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0) |
177 //#define return_cmd_error(errcode) do { _error_message=(errcode); return CMD_ERROR; } while(0) |
178 #define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0) |
178 #define return_cmd_error(errcode) do { return CMD_ERROR | (errcode); } while (0) |
179 |
179 |
|
180 static inline bool CmdFailed(int32 res) |
|
181 { |
|
182 // lower 16bits are the StringID of the possible error |
|
183 return res <= (CMD_ERROR | INVALID_STRING_ID); |
|
184 } |
|
185 |
180 /* command.c */ |
186 /* command.c */ |
181 int32 DoCommand(int x, int y, uint32 p1, uint32 p2, uint32 flags, uint procc); |
187 int32 DoCommand(int x, int y, uint32 p1, uint32 p2, uint32 flags, uint procc); |
182 int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc); |
188 int32 DoCommandByTile(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc); |
183 |
189 |
184 bool IsValidCommand(uint cmd); |
190 bool IsValidCommand(uint cmd); |