summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-08 21:02:12 +0000
committerrubidium <rubidium@openttd.org>2010-09-08 21:02:12 +0000
commitea4b40704b351de69cff4a6beaa4cf526f18bb9b (patch)
tree1e52f45f4b9c8eb28e73a845946519c5074e0571 /src/vehicle_cmd.cpp
parent9badab6454d18378fc81962c8883e9594b968276 (diff)
downloadopenttd-ea4b40704b351de69cff4a6beaa4cf526f18bb9b.tar.xz
(svn r20769) -Codechange: move some depot flags from p2 to p1 in CmdSendVehicleToDepot
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 5670e2e71..b65be4c40 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -823,7 +823,7 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool s
bool had_success = false;
for (uint i = 0; i < list.Length(); i++) {
const Vehicle *v = list[i];
- CommandCost ret = DoCommand(v->tile, v->index, (service ? 1 : 0) | DEPOT_DONT_CANCEL, flags, GetCmdSendToDepot(type));
+ CommandCost ret = DoCommand(v->tile, v->index | (service ? DEPOT_SERVICE : 0U) | DEPOT_DONT_CANCEL, 0, flags, GetCmdSendToDepot(type));
if (ret.Succeeded()) {
had_success = true;
@@ -843,7 +843,9 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool s
* Send a vehicle to the depot.
* @param tile unused
* @param flags for command type
- * @param p1 vehicle ID to send to the depot
+ * @param p1 bitmask
+ * - p1 0-20: bitvehicle ID to send to the depot
+ * - p1 bits 25-8 - DEPOT_ flags (see vehicle_type.h)
* @param p2 various bitmasked elements
* - p2 bit 0-3 - DEPOT_ flags (see vehicle.h)
* - p2 bit 8-10 - VLW flag (for mass goto depot)
@@ -853,16 +855,16 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool s
*/
CommandCost CmdSendVehicleToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
- if (p2 & DEPOT_MASS_SEND) {
+ if (p1 & DEPOT_MASS_SEND) {
/* Mass goto depot requested */
if (!ValidVLWFlags(p2 & VLW_MASK)) return CMD_ERROR;
- return SendAllVehiclesToDepot((VehicleType)GB(p2, 11, 2), flags, p2 & DEPOT_SERVICE, _current_company, (p2 & VLW_MASK), p1);
+ return SendAllVehiclesToDepot((VehicleType)GB(p2, 11, 2), flags, p2 & DEPOT_SERVICE, _current_company, (p2 & VLW_MASK), GB(p1, 0, 20));
}
- Vehicle *v = Vehicle::GetIfValid(p1);
+ Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20));
if (v == NULL) return CMD_ERROR;
- return v->SendToDepot(flags, (DepotCommand)(p2 & DEPOT_COMMAND_MASK));
+ return v->SendToDepot(flags, (DepotCommand)(p1 & DEPOT_COMMAND_MASK));
}
/**