diff options
author | frosch <frosch@openttd.org> | 2008-08-16 14:02:20 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-08-16 14:02:20 +0000 |
commit | 92f3c368b8685580353172e7979c7d7d816db21f (patch) | |
tree | 4c275596da6f577f47cea17f49ee3870846e07cb /src/command_type.h | |
parent | 302cdf69a4f697134b6495252f51a4d3b91b3f67 (diff) | |
download | openttd-92f3c368b8685580353172e7979c7d7d816db21f.tar.xz |
(svn r14083) -Fix [FS#1264, FS#2037, FS#2038, FS#2110]: Rewrite the autoreplace kernel.
Diffstat (limited to 'src/command_type.h')
-rw-r--r-- | src/command_type.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/command_type.h b/src/command_type.h index f3e4116a7..0637673cf 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -101,6 +101,19 @@ public: } /** + * Returns the error message of a command + * @return the error message, if succeeded INVALID_STRING_ID + */ + StringID GetErrorMessage() const + { + extern StringID _error_message; + + if (this->success) return INVALID_STRING_ID; + if (this->message != INVALID_STRING_ID) return this->message; + return _error_message; + } + + /** * Did this command succeed? * @return true if and only if it succeeded */ @@ -259,6 +272,7 @@ enum { CMD_CLONE_VEHICLE, ///< clone a vehicle CMD_START_STOP_VEHICLE, ///< start or stop a vehicle CMD_MASS_START_STOP, ///< start/stop all vehicles (in a depot) + CMD_AUTOREPLACE_VEHICLE, ///< replace/renew a vehicle while it is in a depot CMD_DEPOT_SELL_ALL_VEHICLES, ///< sell all vehicles which are in a given depot CMD_DEPOT_MASS_AUTOREPLACE, ///< force the autoreplace to take action in a given depot @@ -290,7 +304,7 @@ enum { DC_AI_BUILDING = 0x020, ///< special building rules for AI DC_NO_TOWN_RATING = 0x040, ///< town rating does not disallow you from building DC_BANKRUPT = 0x080, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases - DC_AUTOREPLACE = 0x100, ///< autoreplace/autorenew is in progress + DC_AUTOREPLACE = 0x100, ///< autoreplace/autorenew is in progress, this shall disable vehicle limits when building, and ignore certain restrictions when undoing things (like vehicle attach callback) }; /** |