summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2005-03-06 23:46:52 +0000
committerpasky <pasky@openttd.org>2005-03-06 23:46:52 +0000
commitf1f1783aa8172f67f58dc41b12644904261d69c4 (patch)
tree506b967814622522c9fd031daa02d37bc9cc3157
parent028ef2b5b54d0f6eaad5542f3e4487c06b42e4d1 (diff)
downloadopenttd-f1f1783aa8172f67f58dc41b12644904261d69c4.tar.xz
(svn r1952) Fix: Hopefully fixed the enormous towns growth slowdown in large maps. (Inspired by toholio.)
-rw-r--r--town_cmd.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/town_cmd.c b/town_cmd.c
index afdd0fb01..bcee4155f 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -429,18 +429,23 @@ void OnTick_Town(void)
{
uint i;
Town *t;
+ int towns;
if (_game_mode == GM_EDITOR)
return;
- i = _cur_town_ctr;
- if (++_cur_town_ctr >= GetTownPoolSize())
- _cur_town_ctr = 0;
+ /* FIXME: This way we scale for larger map, but not for the smaller
+ * ones. --pasky */
+ for (towns = ScaleByMapSize(1); towns > 0; towns--) {
+ i = _cur_town_ctr;
+ if (++_cur_town_ctr >= GetTownPoolSize())
+ _cur_town_ctr = 0;
- t = GetTown(i);
+ t = GetTown(i);
- if (t->xy != 0)
- TownTickHandler(t);
+ if (t->xy != 0)
+ TownTickHandler(t);
+ }
}
static byte GetTownRoadMask(TileIndex tile)