mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-13 08:22:10 +01:00
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user