summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2008-03-25 21:58:13 +0000
committerbjarni <bjarni@openttd.org>2008-03-25 21:58:13 +0000
commit06c0e5df5a9b043ef9745e3c2cc1653847a110ab (patch)
tree2ad5b9f3e4ccd972190047d82ef084441736287e /src/command.cpp
parent97fb7fb8d9de58786722b350b6a25090baf8fb94 (diff)
downloadopenttd-06c0e5df5a9b043ef9745e3c2cc1653847a110ab.tar.xz
(svn r12421) -Feature: [autoreplace] the autoreplace button in train depots will now also replace wagons even if they aren't connected to a locomotive
fixed estimated cost in CmdDepotMassAutoReplace() (will still not estimate wagon removal profits) Made it possible to command CmdDepotMassAutoReplace() to either replace everything or nothing (the button will still happily replace just some of the vehicles if cash premits)
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/command.cpp b/src/command.cpp
index bb519cbd3..c00a40eaa 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -542,12 +542,16 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
* fact will trigger an assertion failure. --pasky
* CMD_CLONE_VEHICLE: Both building new vehicles and refitting them can be
* influenced by newgrf callbacks, which makes it impossible to accurately
- * estimate the cost of cloning a vehicle. */
+ * estimate the cost of cloning a vehicle.
+ * CMD_DEPOT_MASS_AUTOREPLACE: we can't predict wagon removal so
+ * the test will not include income from any sold wagons.
+ * This means that the costs can sometimes be lower than estimated. */
notest =
(cmd & 0xFF) == CMD_CLEAR_AREA ||
(cmd & 0xFF) == CMD_LEVEL_LAND ||
(cmd & 0xFF) == CMD_REMOVE_LONG_ROAD ||
- (cmd & 0xFF) == CMD_CLONE_VEHICLE;
+ (cmd & 0xFF) == CMD_CLONE_VEHICLE ||
+ (cmd & 0xFF) == CMD_DEPOT_MASS_AUTOREPLACE;
_docommand_recursive = 1;