diff options
author | tron <tron@openttd.org> | 2006-04-23 19:35:36 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-04-23 19:35:36 +0000 |
commit | c1dc517dab10acb049f35e80f94508bbcecf3193 (patch) | |
tree | 020949ed699a5b1e636d9d4da8e68db3751bf261 /disaster_cmd.c | |
parent | 8ef2c13c65498dfc39cb80bd1c07589b747fe1e6 (diff) | |
download | openttd-c1dc517dab10acb049f35e80f94508bbcecf3193.tar.xz |
(svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE}
Diffstat (limited to 'disaster_cmd.c')
-rw-r--r-- | disaster_cmd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c index da4c3e766..ec1301405 100644 --- a/disaster_cmd.c +++ b/disaster_cmd.c @@ -516,8 +516,8 @@ static void DisasterTick_4(Vehicle *v) v->tick_counter++; if (v->current_order.station == 1) { - int x = TileX(v->dest_tile) * TILE_SIZE + 8; - int y = TileY(v->dest_tile) * TILE_SIZE + 8; + int x = TileX(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2; + int y = TileY(v->dest_tile) * TILE_SIZE + TILE_SIZE / 2; if (abs(v->x_pos - x) + abs(v->y_pos - y) >= 8) { v->direction = GetDirectionTowards(v, x, y); @@ -715,7 +715,7 @@ static void Disaster0_Init(void) /* Pick a random place, unless we find a small airport */ - x = TileX(Random()) * TILE_SIZE + 8; + x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2; FOR_ALL_STATIONS(st) { if (st->xy && st->airport_tile != 0 && @@ -745,7 +745,7 @@ static void Disaster1_Init(void) if (v == NULL) return; - x = TileX(Random()) * TILE_SIZE + 8; + x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2; InitializeDisasterVehicle(v, x, 0, 135, DIR_SE, 2); v->dest_tile = TileXY(MapSizeX() / 2, MapSizeY() / 2); @@ -845,7 +845,7 @@ static void Disaster4_Init(void) if (v == NULL) return; - x = TileX(Random()) * TILE_SIZE + 8; + x = TileX(Random()) * TILE_SIZE + TILE_SIZE / 2; y = MapMaxX() * TILE_SIZE - 1; InitializeDisasterVehicle(v, x, y, 135, DIR_NW, 9); @@ -872,13 +872,13 @@ static void Disaster5_Init(void) if (v == NULL) return; r = Random(); - x = TileX(r) * TILE_SIZE + 8; + x = TileX(r) * TILE_SIZE + TILE_SIZE / 2; if (r & 0x80000000) { - y = MapMaxX() * TILE_SIZE - 8 - 1; + y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1; dir = DIR_NW; } else { - y = 8; + y = TILE_SIZE / 2; dir = DIR_SE; } InitializeDisasterVehicle(v, x, y, 0, dir, 13); @@ -896,13 +896,13 @@ static void Disaster6_Init(void) if (v == NULL) return; r = Random(); - x = TileX(r) * TILE_SIZE + 8; + x = TileX(r) * TILE_SIZE + TILE_SIZE / 2; if (r & 0x80000000) { - y = MapMaxX() * TILE_SIZE - 8 - 1; + y = MapMaxX() * TILE_SIZE - TILE_SIZE / 2 - 1; dir = DIR_NW; } else { - y = 8; + y = TILE_SIZE / 2; dir = DIR_SE; } InitializeDisasterVehicle(v, x, y, 0, dir, 14); |