Network: Include town noise levels in network game saves

Don't recalculate on load for network clients
This commit is contained in:
Jonathan G Rennison
2023-12-26 20:02:57 +00:00
parent 2e9cb16254
commit ae1729fa50
2 changed files with 32 additions and 8 deletions

View File

@@ -70,6 +70,8 @@
#include "safeguards.h"
bool _town_noise_no_update = false;
/**
* Check whether the given tile is a hangar.
* @param t the tile to of whether it is a hangar.
@@ -2639,6 +2641,8 @@ Town *AirportGetNearestTown(const AirportSpec *as, TileIndex tile, const TileIte
/** Recalculate the noise generated by the airports of each town */
void UpdateAirportsNoise()
{
if (_town_noise_no_update) return;
for (Town *t : Town::Iterate()) t->noise_reached = 0;
for (const Station *st : Station::Iterate()) {