(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.
This commit is contained in:
tron
2005-01-28 15:31:04 +00:00
parent 4e6d6578e4
commit 3617d24318
9 changed files with 45 additions and 18 deletions

View File

@@ -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();