From 6013b327f7d54f9d5a331b105011c238da97046f Mon Sep 17 00:00:00 2001 From: ludde Date: Wed, 13 Jul 2005 19:51:31 +0000 Subject: (svn r2560) Fix: various minor code changes. Added RandomTile/RandomTileSeed functions to generate a random tile. Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though) Changed some frequently used map macros to not compute the values each time. Silence some warnings on MSVC. --- disaster_cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'disaster_cmd.c') diff --git a/disaster_cmd.c b/disaster_cmd.c index 19609f7dd..90e005df5 100644 --- a/disaster_cmd.c +++ b/disaster_cmd.c @@ -269,7 +269,7 @@ static void DisasterTick_UFO(Vehicle *v) return; } if (++v->age < 6) { - v->dest_tile = TILE_MASK(Random()); + v->dest_tile = RandomTile(); return; } v->current_order.station = 1; @@ -571,12 +571,12 @@ static void DisasterTick_4(Vehicle *v) } if (++v->age < 6) { - v->dest_tile = TILE_MASK(Random()); + v->dest_tile = RandomTile(); return; } v->current_order.station = 1; - tile_org = tile = TILE_MASK(Random()); + tile_org = tile = RandomTile(); do { if (IsTileType(tile, MP_RAILWAY) && (_m[tile].m5 & ~3) != 0xC0 && IS_HUMAN_PLAYER(GetTileOwner(tile))) -- cgit v1.2.3-54-g00ecf