summaryrefslogtreecommitdiff
path: root/town_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-28 15:31:04 +0000
committertron <tron@openttd.org>2005-01-28 15:31:04 +0000
commit3617d243189ec7076bec045d04e4a96ff55a8de8 (patch)
treeefbaeb3426c01178731116a7fca722dc190ac78f /town_cmd.c
parent4e6d6578e4e4d17712acff4b0c1f749f405a815d (diff)
downloadopenttd-3617d243189ec7076bec045d04e4a96ff55a8de8.tar.xz
(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
These scale a number relative to the map size/circumference. Use them to scale the amount of map objects. Of course at the moment they return just the input, because there are no bigger/smaller maps yet.
Diffstat (limited to 'town_cmd.c')
-rw-r--r--town_cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/town_cmd.c b/town_cmd.c
index 73cab9989..836657ab6 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -1036,8 +1036,9 @@ static const byte _num_initial_towns[3] = {
void GenerateTowns(void)
{
- uint n;
- n = _num_initial_towns[_opt.diff.number_towns] + (Random()&7);
+ uint n =
+ ScaleByMapSize(_num_initial_towns[_opt.diff.number_towns] + (Random() & 7));
+
do CreateRandomTown(); while (--n);
}