summaryrefslogtreecommitdiff
path: root/tree_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
commit400f07fdb834dc99aa8a2a4695e20b36e5d23dc4 (patch)
treeefbaeb3426c01178731116a7fca722dc190ac78f /tree_cmd.c
parent6d410929b6fc96eda09a5060d6665cc5dc800f03 (diff)
downloadopenttd-400f07fdb834dc99aa8a2a4695e20b36e5d23dc4.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 'tree_cmd.c')
-rw-r--r--tree_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tree_cmd.c b/tree_cmd.c
index eb43c21f9..bf9fbdb73 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -90,7 +90,7 @@ static void DoPlaceMoreTrees(uint tile)
static void PlaceMoreTrees(void)
{
- int i = (Random() & 0x1F) + 25;
+ int i = ScaleByMapSize((Random() & 0x1F) + 25);
do {
DoPlaceMoreTrees(TILE_MASK(Random()));
} while (--i);
@@ -102,7 +102,7 @@ void PlaceTreesRandomly(void)
uint32 r;
uint tile;
- i = 1000;
+ i = ScaleByMapSize(1000);
do {
r = Random();
tile = TILE_MASK(r);
@@ -114,7 +114,7 @@ void PlaceTreesRandomly(void)
/* place extra trees at rainforest area */
if (_opt.landscape == LT_DESERT) {
- i = 15000;
+ i = ScaleByMapSize(15000);
do {
r = Random();