summaryrefslogtreecommitdiff
path: root/unmovable_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 /unmovable_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 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 9ffc4a235..129e22c28 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -258,8 +258,8 @@ void GenerateUnmovables(void)
return;
/* add radio tower */
- i = 1000;
- j = 40; // limit of 40 radio towers per world.
+ i = ScaleByMapSize(1000);
+ j = ScaleByMapSize(40); // maximum number of radio towers on the map
do {
r = Random();
tile = r % MapSize();
@@ -280,7 +280,7 @@ void GenerateUnmovables(void)
return;
/* add lighthouses */
- i = (Random()&3) + 7;
+ i = ScaleByMapSize1D((Random() & 3) + 7);
do {
restart:
r = Random();