diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -558,7 +558,7 @@ uint VehicleCargoList::Reassign(uint max { static_assert(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); static_assert(Tfrom - Tto == 1 || Tto - Tfrom == 1); - max_move = min(this->action_counts[Tfrom], max_move); + max_move = std::min(this->action_counts[Tfrom], max_move); this->action_counts[Tfrom] -= max_move; this->action_counts[Tto] += max_move; return max_move; @@ -574,7 +574,7 @@ uint VehicleCargoList::Reassign(uint max template<> uint VehicleCargoList::Reassign(uint max_move, TileOrStationID next_station) { - max_move = min(this->action_counts[MTA_DELIVER], max_move); + max_move = std::min(this->action_counts[MTA_DELIVER], max_move); uint sum = 0; for (Iterator it(this->packets.begin()); sum < this->action_counts[MTA_TRANSFER] + max_move;) { @@ -603,7 +603,7 @@ uint VehicleCargoList::Reassignaction_counts[MTA_LOAD], max_move); + max_move = std::min(this->action_counts[MTA_LOAD], max_move); this->PopCargo(CargoReturn(this, dest, max_move, next)); return max_move; } @@ -616,7 +616,7 @@ uint VehicleCargoList::Return(uint max_m */ uint VehicleCargoList::Shift(uint max_move, VehicleCargoList *dest) { - max_move = min(this->count, max_move); + max_move = std::min(this->count, max_move); this->PopCargo(CargoShift(this, dest, max_move)); return max_move; } @@ -633,12 +633,12 @@ uint VehicleCargoList::Unload(uint max_m { uint moved = 0; if (this->action_counts[MTA_TRANSFER] > 0) { - uint move = min(this->action_counts[MTA_TRANSFER], max_move); + uint move = std::min(this->action_counts[MTA_TRANSFER], max_move); this->ShiftCargo(CargoTransfer(this, dest, move)); moved += move; } if (this->action_counts[MTA_TRANSFER] == 0 && this->action_counts[MTA_DELIVER] > 0 && moved < max_move) { - uint move = min(this->action_counts[MTA_DELIVER], max_move - moved); + uint move = std::min(this->action_counts[MTA_DELIVER], max_move - moved); this->ShiftCargo(CargoDelivery(this, move, payment)); moved += move; } @@ -653,7 +653,7 @@ uint VehicleCargoList::Unload(uint max_m */ uint VehicleCargoList::Truncate(uint max_move) { - max_move = min(this->count, max_move); + max_move = std::min(this->count, max_move); this->PopCargo(CargoRemoval(this, max_move)); return max_move; } @@ -668,7 +668,7 @@ uint VehicleCargoList::Truncate(uint max */ uint VehicleCargoList::Reroute(uint max_move, VehicleCargoList *dest, StationID avoid, StationID avoid2, const GoodsEntry *ge) { - max_move = min(this->action_counts[MTA_TRANSFER], max_move); + max_move = std::min(this->action_counts[MTA_TRANSFER], max_move); this->ShiftCargo(VehicleCargoReroute(this, dest, max_move, avoid, avoid2, ge)); return max_move; } @@ -768,7 +768,7 @@ uint StationCargoList::ShiftCargo(Tactio */ uint StationCargoList::Truncate(uint max_move, StationCargoAmountMap *cargo_per_source) { - max_move = min(max_move, this->count); + max_move = std::min(max_move, this->count); uint prev_count = this->count; uint moved = 0; uint loop = 0; @@ -839,7 +839,7 @@ uint StationCargoList::Reserve(uint max_ */ uint StationCargoList::Load(uint max_move, VehicleCargoList *dest, TileIndex load_place, StationIDStack next_station) { - uint move = min(dest->ActionCount(VehicleCargoList::MTA_LOAD), max_move); + uint move = std::min(dest->ActionCount(VehicleCargoList::MTA_LOAD), max_move); if (move > 0) { this->reserved_count -= move; dest->Reassign(move);