Vehicle list commands now take into account cargo type filter
Start/stop Send to depot type commands Add to new group Change order target
This commit is contained in:
@@ -3508,6 +3508,7 @@ bool Order::CanLeaveWithCargo(bool has_cargo, CargoID cargo) const
|
||||
* - p1 = (bit 0 - 15) - The destination ID to change from
|
||||
* - p1 = (bit 16 - 18) - The vehicle type
|
||||
* - p1 = (bit 20 - 23) - The order type
|
||||
* - p1 = (bit 24 - 31) - Cargo filter
|
||||
* @param p2 various bitstuffed elements
|
||||
* - p2 = (bit 0 - 15) - The destination ID to change to
|
||||
* @param text unused
|
||||
@@ -3518,11 +3519,12 @@ CommandCost CmdMassChangeOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
DestinationID from_dest = GB(p1, 0, 16);
|
||||
VehicleType vehtype = Extract<VehicleType, 16, 3>(p1);
|
||||
OrderType order_type = (OrderType) GB(p1, 20, 4);
|
||||
CargoID cargo_filter = GB(p1, 24, 8);
|
||||
DestinationID to_dest = GB(p2, 0, 16);
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
for (Vehicle *v : Vehicle::Iterate()) {
|
||||
if (v->type == vehtype && v->IsPrimaryVehicle() && CheckOwnership(v->owner).Succeeded()) {
|
||||
if (v->type == vehtype && v->IsPrimaryVehicle() && CheckOwnership(v->owner).Succeeded() && VehicleCargoFilter(v, cargo_filter)) {
|
||||
int index = 0;
|
||||
bool changed = false;
|
||||
|
||||
|
Reference in New Issue
Block a user