(svn r2582) Fix: Prevent generating unrealistically many Oil refineries on large maps. They are always placed next to the borderline, so the perimeter is used instead of area to scale the number of those industries.
authorludde
Fri, 15 Jul 2005 19:51:54 +0000
changeset 2072 66d208875eda
parent 2071 3083c580f4dc
child 2073 2d63300e4a44
(svn r2582) Fix: Prevent generating unrealistically many Oil refineries on large maps. They are always placed next to the borderline, so the perimeter is used instead of area to scale the number of those industries.
industry_cmd.c
--- a/industry_cmd.c	Fri Jul 15 18:43:39 2005 +0000
+++ b/industry_cmd.c	Fri Jul 15 19:51:54 2005 +0000
@@ -1647,8 +1647,14 @@
 
 static void PlaceInitialIndustry(byte type, int amount)
 {
-	int num =
-		ScaleByMapSize(_numof_industry_table[_opt.diff.number_industries][amount]);
+	int num = _numof_industry_table[_opt.diff.number_industries][amount];
+
+	if (type == IT_OIL_REFINERY || type == IT_OIL_RIG) {
+		// These are always placed next to the coastline, so we scale by the perimeter instead.
+		num = ScaleByMapSize1D(num);
+	} else {
+		num = ScaleByMapSize(num);
+	}
 
 	if (_opt.diff.number_industries != 0)
 	{