summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-15 19:51:54 +0000
committerludde <ludde@openttd.org>2005-07-15 19:51:54 +0000
commitc964809d374ef9af63a384a1bd7bc01cdc1bbbf5 (patch)
tree53e510a0701998c331ea347507477a5c7cb70a27
parent6a3f58e050bf3d023b27eee25043bb0000b345e3 (diff)
downloadopenttd-c964809d374ef9af63a384a1bd7bc01cdc1bbbf5.tar.xz
(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.
-rw-r--r--industry_cmd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index e2860a477..410d35cf0 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -1647,8 +1647,14 @@ static const byte _numof_industry_table[4][12] = {
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)
{