Update to 12.0-beta2

This commit is contained in:
dP
2021-08-19 23:05:31 +03:00
parent 7ade3d06e6
commit c9765f712f
45 changed files with 396 additions and 104 deletions

View File

@@ -2359,7 +2359,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
if (_settings_game.economy.station_noise_level) {
SetWindowDirty(WC_TOWN_VIEW, st->town->index);
SetWindowDirty(WC_TOWN_VIEW, nearest->index);
}
}
@@ -2407,6 +2407,10 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
uint dist;
Town *nearest = AirportGetNearestTown(as, it, dist);
nearest->noise_reached -= GetAirportNoiseLevelForDistance(as, dist);
if (_settings_game.economy.station_noise_level) {
SetWindowDirty(WC_TOWN_VIEW, nearest->index);
}
}
for (TileIndex tile_cur : st->airport) {
@@ -2435,10 +2439,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
InvalidateWindowData(WC_STATION_VIEW, st->index, -1);
if (_settings_game.economy.station_noise_level) {
SetWindowDirty(WC_TOWN_VIEW, st->town->index);
}
Company::Get(st->owner)->infrastructure.airport--;
st->AfterStationTileSetChange(false, STATION_AIRPORT);
@@ -3737,7 +3737,7 @@ void DeleteStaleLinks(Station *from)
* @param usage Usage to add to link stat.
* @param mode Update mode to be applied.
*/
void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage, EdgeUpdateMode mode)
void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint capacity, uint usage, uint32 time, EdgeUpdateMode mode)
{
GoodsEntry &ge1 = st->goods[cargo];
Station *st2 = Station::Get(next_station_id);
@@ -3779,7 +3779,7 @@ void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint c
}
}
if (lg != nullptr) {
(*lg)[ge1.node].UpdateEdge(ge2.node, capacity, usage, mode);
(*lg)[ge1.node].UpdateEdge(ge2.node, capacity, usage, time, mode);
}
}
@@ -3789,7 +3789,7 @@ void IncreaseStats(Station *st, CargoID cargo, StationID next_station_id, uint c
* @param front First vehicle in the consist.
* @param next_station_id Station the consist will be travelling to next.
*/
void IncreaseStats(Station *st, const Vehicle *front, StationID next_station_id)
void IncreaseStats(Station *st, const Vehicle *front, StationID next_station_id, uint32 time)
{
for (const Vehicle *v = front; v != nullptr; v = v->Next()) {
if (v->refit_cap > 0) {
@@ -3800,7 +3800,7 @@ void IncreaseStats(Station *st, const Vehicle *front, StationID next_station_id)
* As usage is not such an important figure anyway we just
* ignore the additional cargo then.*/
IncreaseStats(st, v->cargo_type, next_station_id, v->refit_cap,
std::min<uint>(v->refit_cap, v->cargo.StoredCount()), EUM_INCREASE);
std::min<uint>(v->refit_cap, v->cargo.StoredCount()), time, EUM_INCREASE);
}
}
}