(svn r1952) Fix: Hopefully fixed the enormous towns growth slowdown in large maps. (Inspired by toholio.)
authorpasky
Sun, 06 Mar 2005 23:46:52 +0000
changeset 1448 ab3017415479
parent 1447 3f1c82502413
child 1449 71331c8f3f90
(svn r1952) Fix: Hopefully fixed the enormous towns growth slowdown in large maps. (Inspired by toholio.)
town_cmd.c
--- a/town_cmd.c	Sun Mar 06 23:21:57 2005 +0000
+++ b/town_cmd.c	Sun Mar 06 23:46:52 2005 +0000
@@ -429,18 +429,23 @@
 {
 	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)