Advertisement
Guest User

Untitled

a guest
Nov 19th, 2021
30
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     uint16 x = (t->larger_town ?
  2.                 _settings_game.citymania.mapgen.custom_city_house_count :
  3.                 _settings_game.citymania.mapgen.custom_town_house_count);
  4.     if (!x) return false;  // fall back to default generation
  5.  
  6.     // limited size generation
  7.     int expected_size = t->cache.num_houses + x;
  8.  
  9.     int i = (int)x * 4, j = x;
  10.     if (_settings_game.game_creation.landscape == LT_TROPIC ||
  11.             _settings_game.game_creation.landscape == LT_ARCTIC) {
  12.         i *= 4;
  13.     }
  14.  
  15.     do {
  16.         t->cache.num_houses = expected_size;
  17.         UpdateTownRadius(t);
  18.         GrowTown(t);
  19.         j -= t->cache.num_houses - expected_size;
  20.     } while (--i && j);
  21.  
  22.     t->cache.num_houses = expected_size - j;
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement