summaryrefslogtreecommitdiff
path: root/src/group_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-09-08 21:40:00 +0000
committerrubidium <rubidium@openttd.org>2010-09-08 21:40:00 +0000
commit4b605f51abceef248c0197bf3c67091d8cafcdeb (patch)
treeeb89c55204e4f699e349a68e30bdf5b7bd6c2580 /src/group_gui.cpp
parentf5128695c54ad634e1ac45ae4271c1db5ed15fad (diff)
downloadopenttd-4b605f51abceef248c0197bf3c67091d8cafcdeb.tar.xz
(svn r20773) -Codechange: use packed VehicleListIdentifiers for some commands as well
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r--src/group_gui.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index f413046a2..9f3ec7ef6 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -482,10 +482,10 @@ public:
case GRP_WIDGET_START_ALL:
case GRP_WIDGET_STOP_ALL: { // Start/stop all vehicles of the list
- DoCommandP(0, (1 << 1) | (widget == GRP_WIDGET_START_ALL ? (1 << 0) : 0),
- ((IsAllGroupID(this->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST) & VLW_MASK)
- | (this->group_sel << 16)
- | this->vehicle_type, CMD_MASS_START_STOP);
+ VehicleListIdentifier vli(this->window_number);
+ vli.type = IsAllGroupID(this->group_sel) ? VL_STANDARD : VL_GROUP_LIST;
+ vli.index = this->group_sel;
+ DoCommandP(0, (1 << 1) | (widget == GRP_WIDGET_START_ALL ? (1 << 0) : 0), vli.Pack(), CMD_MASS_START_STOP);
break;
}
@@ -573,13 +573,14 @@ public:
ShowReplaceGroupVehicleWindow(this->group_sel, this->vehicle_type);
break;
case ADI_SERVICE: // Send for servicing
- DoCommandP(0, this->group_sel | DEPOT_MASS_SEND | DEPOT_SERVICE, ((IsAllGroupID(this->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST) & VLW_MASK) |
- this->vehicle_type << 11, GetCmdSendToDepot(this->vehicle_type));
- break;
- case ADI_DEPOT: // Send to Depots
- DoCommandP(0, this->group_sel | DEPOT_MASS_SEND, ((IsAllGroupID(this->group_sel) ? VLW_STANDARD : VLW_GROUP_LIST) & VLW_MASK) |
- this->vehicle_type << 11, GetCmdSendToDepot(this->vehicle_type));
+ case ADI_DEPOT: { // Send to Depots
+ VehicleListIdentifier vli(this->window_number);
+ vli.type = IsAllGroupID(this->group_sel) ? VL_STANDARD : VL_GROUP_LIST;
+ vli.index = this->group_sel;
+ DoCommandP(0, DEPOT_MASS_SEND | (index == ADI_SERVICE ? DEPOT_SERVICE : 0U), vli.Pack(), GetCmdSendToDepot(this->vehicle_type));
break;
+ }
+
case ADI_ADD_SHARED: // Add shared Vehicles
assert(Group::IsValidID(this->group_sel));