mirror of https://github.com/OpenTTD/OpenTTD
Fix d450d4743: Division by zero when larger_towns is set to 0. (#13104)
Universe ended.pull/13106/head
parent
9b6b6d50c3
commit
b730f8783e
|
@ -2401,7 +2401,7 @@ bool GenerateTowns(TownLayout layout)
|
||||||
|
|
||||||
/* Randomised offset for city status. This means with e.g. 1-in-4 towns being cities, a map with 10 towns
|
/* Randomised offset for city status. This means with e.g. 1-in-4 towns being cities, a map with 10 towns
|
||||||
* may have 2 or 3 cities, instead of always 3. */
|
* may have 2 or 3 cities, instead of always 3. */
|
||||||
uint city_random_offset = Random() % _settings_game.economy.larger_towns;
|
uint city_random_offset = _settings_game.economy.larger_towns == 0 ? 0 : (Random() % _settings_game.economy.larger_towns);
|
||||||
|
|
||||||
/* First attempt will be made at creating the suggested number of towns.
|
/* First attempt will be made at creating the suggested number of towns.
|
||||||
* Note that this is really a suggested value, not a required one.
|
* Note that this is really a suggested value, not a required one.
|
||||||
|
|
Loading…
Reference in New Issue