1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 10:22:39 +01:00

Change: Scale towns/industries by amount of land tiles. (#10063)

This commit is contained in:
Peter Nelson
2025-10-24 21:32:09 +01:00
committed by GitHub
parent 70bf84175f
commit a1920fc225
8 changed files with 115 additions and 43 deletions

View File

@@ -55,6 +55,7 @@
#include "road_cmd.h"
#include "terraform_cmd.h"
#include "tunnelbridge_cmd.h"
#include "map_func.h"
#include "timer/timer.h"
#include "timer/timer_game_calendar.h"
#include "timer/timer_game_economy.h"
@@ -2420,9 +2421,9 @@ bool GenerateTowns(TownLayout layout, std::optional<uint> number)
if (number.has_value()) {
total = number.value();
} else if (_settings_game.difficulty.number_towns == static_cast<uint>(CUSTOM_TOWN_NUMBER_DIFFICULTY)) {
total = GetDefaultTownsForMapSize();
total = Map::ScaleByLandProportion(GetDefaultTownsForMapSize());
} else {
total = GetDefaultTownsForMapSize() + (Random() & 7);
total = Map::ScaleByLandProportion(GetDefaultTownsForMapSize() + (Random() & 7));
}
total = std::min<uint>(TownPool::MAX_SIZE, total);