Merge remote-tracking branch 'upstream/1.11' into 1.11
This commit is contained in:
@@ -2399,6 +2399,12 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||
}
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
for (uint i = 0; i < st->airport.GetNumHangars(); ++i) {
|
||||
DeleteWindowById(
|
||||
WC_VEHICLE_DEPOT, st->airport.GetHangarTile(i)
|
||||
);
|
||||
}
|
||||
|
||||
const AirportSpec *as = st->airport.GetSpec();
|
||||
/* The noise level is the noise from the airport and reduce it to account for the distance to the town center.
|
||||
* And as for construction, always remove it, even if the setting is not set, in order to avoid the
|
||||
@@ -2429,12 +2435,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||
/* Clear the persistent storage. */
|
||||
delete st->airport.psa;
|
||||
|
||||
for (uint i = 0; i < st->airport.GetNumHangars(); ++i) {
|
||||
DeleteWindowById(
|
||||
WC_VEHICLE_DEPOT, st->airport.GetHangarTile(i)
|
||||
);
|
||||
}
|
||||
|
||||
st->rect.AfterRemoveRect(st, st->airport);
|
||||
|
||||
st->airport.Clear();
|
||||
@@ -4043,7 +4043,7 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
|
||||
first_station = st;
|
||||
continue;
|
||||
}
|
||||
if (used_stations.empty()) {
|
||||
if (used_stations.empty()) {
|
||||
used_stations.reserve(2);
|
||||
used_stations.emplace_back(std::make_pair(first_station, 0));
|
||||
}
|
||||
@@ -4088,9 +4088,9 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
|
||||
moving += p.second;
|
||||
}
|
||||
|
||||
/* If there is some cargo left due to rounding issues distribute it among the best rated stations. */
|
||||
/* If there is some cargo left due to rounding issues distribute it among the best rated stations. */
|
||||
if (amount > moving) {
|
||||
std::sort(used_stations.begin(), used_stations.end(), [type] (const StationInfo &a, const StationInfo &b) {
|
||||
std::sort(used_stations.begin(), used_stations.end(), [type](const StationInfo &a, const StationInfo &b) {
|
||||
return b.first->goods[type].rating < a.first->goods[type].rating;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user