summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-03 12:56:22 +0000
committertron <tron@openttd.org>2005-01-03 12:56:22 +0000
commit32bfe0dddde81d016cb8de15e6a41bca3506d7be (patch)
tree04b3f2dd580a9cd8387358c91a0cfcf95a525153 /unmovable_cmd.c
parent4c14afba4eae4bbfe3d448eeaa072e11b326c78a (diff)
downloadopenttd-32bfe0dddde81d016cb8de15e6a41bca3506d7be.tar.xz
(svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY]
While here replace one erroneous TILE_MAX_X with MapMaxY()
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 277086a9c..137f66461 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -285,12 +285,12 @@ void GenerateUnmovables()
restart:
r = Random();
dir = r >> 30;
- r = r%((dir==0 || dir== 2)?TILE_Y_MAX:TILE_X_MAX);
+ r %= (dir == 0 || dir == 2) ? MapMaxY() : MapMaxX();
tile =
(dir==0)?TILE_XY(0,r):0 + // left
(dir==1)?TILE_XY(r,0):0 + // top
- (dir==2)?TILE_XY(TILE_X_MAX,r):0 + // right
- (dir==3)?TILE_XY(r,TILE_Y_MAX):0; // bottom
+ (dir == 2) ? TILE_XY(MapMaxX(), r) : 0 + // right
+ (dir == 3) ? TILE_XY(r, MapMaxY()) : 0; // bottom
j = 20;
do {
if (--j == 0)