diff options
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r-- | src/group_gui.cpp | 21 |
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)); |