1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-13 08:22:10 +01:00

Fix #14737: Don't scale custom town and industry counts by land area (#14738)

This commit is contained in:
Tyler Trahan
2025-10-27 14:18:31 -04:00
committed by GitHub
parent b43cdcba01
commit d1376d0b67
2 changed files with 3 additions and 3 deletions

View File

@@ -2494,8 +2494,8 @@ void GenerateIndustries()
/* Total number of industries scaled by land/water proportion. */ /* Total number of industries scaled by land/water proportion. */
uint total_amount = p.total * GetNumberOfIndustries() / (lprob.total + wprob.total); uint total_amount = p.total * GetNumberOfIndustries() / (lprob.total + wprob.total);
/* Scale land-based industries to the land proportion. */ /* Scale land-based industries to the land proportion, unless the player has set a custom industry count. */
if (!water) total_amount = Map::ScaleByLandProportion(total_amount); if (!water && _settings_game.difficulty.industry_density != ID_CUSTOM) total_amount = Map::ScaleByLandProportion(total_amount);
/* Ensure that forced industries are generated even if the scaled amounts are too low. */ /* Ensure that forced industries are generated even if the scaled amounts are too low. */
if (p.total == 0 || total_amount < p.num_forced) { if (p.total == 0 || total_amount < p.num_forced) {

View File

@@ -2421,7 +2421,7 @@ bool GenerateTowns(TownLayout layout, std::optional<uint> number)
if (number.has_value()) { if (number.has_value()) {
total = number.value(); total = number.value();
} else if (_settings_game.difficulty.number_towns == static_cast<uint>(CUSTOM_TOWN_NUMBER_DIFFICULTY)) { } else if (_settings_game.difficulty.number_towns == static_cast<uint>(CUSTOM_TOWN_NUMBER_DIFFICULTY)) {
total = Map::ScaleByLandProportion(GetDefaultTownsForMapSize()); total = GetDefaultTownsForMapSize();
} else { } else {
total = Map::ScaleByLandProportion(GetDefaultTownsForMapSize() + (Random() & 7)); total = Map::ScaleByLandProportion(GetDefaultTownsForMapSize() + (Random() & 7));
} }