summaryrefslogtreecommitdiff
path: root/disaster_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-13 18:04:01 +0000
committertron <tron@openttd.org>2005-07-13 18:04:01 +0000
commit8c1d74162f1544e351ae6308cbcca06f324c2c36 (patch)
treeb36523450a7bccf37ca126b6f857d1529d44c67b /disaster_cmd.c
parent1a1dde7c8d0cf18e49b5af7fef1368216120eed1 (diff)
downloadopenttd-8c1d74162f1544e351ae6308cbcca06f324c2c36.tar.xz
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
Diffstat (limited to 'disaster_cmd.c')
-rw-r--r--disaster_cmd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c
index fc0ad67cc..19609f7dd 100644
--- a/disaster_cmd.c
+++ b/disaster_cmd.c
@@ -172,12 +172,12 @@ static void DisasterTick_Zeppeliner(Vehicle *v)
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
- IS_BYTE_INSIDE(_map5[tile], 8, 0x43) &&
+ IS_BYTE_INSIDE(_m[tile].m5, 8, 0x43) &&
IS_HUMAN_PLAYER(GetTileOwner(tile))) {
v->current_order.station = 1;
v->age = 0;
- SetDParam(0, _map2[tile]);
+ SetDParam(0, _m[tile].m2);
AddNewsItem(STR_B000_ZEPPELIN_DISASTER_AT,
NEWS_FLAGS(NM_THIN, NF_VIEWPORT|NF_VEHICLE, NT_ACCIDENT, 0),
v->index,
@@ -197,9 +197,9 @@ static void DisasterTick_Zeppeliner(Vehicle *v)
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
- IS_BYTE_INSIDE(_map5[tile], 8, 0x43) &&
+ IS_BYTE_INSIDE(_m[tile].m5, 8, 0x43) &&
IS_HUMAN_PLAYER(GetTileOwner(tile))) {
- st = GetStation(_map2[tile]);
+ st = GetStation(_m[tile].m2);
CLRBITS(st->airport_flags, RUNWAY_IN_block);
}
@@ -239,10 +239,10 @@ static void DisasterTick_Zeppeliner(Vehicle *v)
tile = v->tile;/**/
if (IsValidTile(tile) &&
IsTileType(tile, MP_STATION) &&
- IS_BYTE_INSIDE(_map5[tile], 8, 0x43) &&
+ IS_BYTE_INSIDE(_m[tile].m5, 8, 0x43) &&
IS_HUMAN_PLAYER(GetTileOwner(tile))) {
- st = GetStation(_map2[tile]);
+ st = GetStation(_m[tile].m2);
SETBITS(st->airport_flags, RUNWAY_IN_block);
}
}
@@ -332,8 +332,8 @@ static void DestructIndustry(Industry *i)
TileIndex tile;
for (tile = 0; tile != MapSize(); tile++) {
- if (IsTileType(tile, MP_INDUSTRY) && _map2[tile] == i->index) {
- _map_owner[tile] = 0;
+ if (IsTileType(tile, MP_INDUSTRY) && _m[tile].m2 == i->index) {
+ _m[tile].owner = 0;
MarkTileDirtyByTile(tile);
}
}
@@ -401,7 +401,7 @@ static void DisasterTick_2(Vehicle *v)
if (!IsTileType(tile, MP_INDUSTRY))
return;
- v->dest_tile = ind = _map2[tile];
+ v->dest_tile = ind = _m[tile].m2;
if (GetIndustry(ind)->type == IT_OIL_REFINERY) {
v->current_order.station = 1;
@@ -472,7 +472,7 @@ static void DisasterTick_3(Vehicle *v)
if (!IsTileType(tile, MP_INDUSTRY))
return;
- v->dest_tile = ind = _map2[tile];
+ v->dest_tile = ind = _m[tile].m2;
if (GetIndustry(ind)->type == IT_FACTORY) {
v->current_order.station = 1;
@@ -579,7 +579,7 @@ static void DisasterTick_4(Vehicle *v)
tile_org = tile = TILE_MASK(Random());
do {
if (IsTileType(tile, MP_RAILWAY) &&
- (_map5[tile] & ~3) != 0xC0 && IS_HUMAN_PLAYER(GetTileOwner(tile)))
+ (_m[tile].m5 & ~3) != 0xC0 && IS_HUMAN_PLAYER(GetTileOwner(tile)))
break;
tile = TILE_MASK(tile+1);
} while (tile != tile_org);