diff options
author | tron <tron@openttd.org> | 2005-07-13 18:04:01 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-13 18:04:01 +0000 |
commit | a4bf608d406442a5edab837ca100e654b616e1ff (patch) | |
tree | b36523450a7bccf37ca126b6f857d1529d44c67b /unmovable_cmd.c | |
parent | fd0780eeef43e6a8aefc943f7f470e409e0db93b (diff) | |
download | openttd-a4bf608d406442a5edab837ca100e654b616e1ff.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 'unmovable_cmd.c')
-rw-r--r-- | unmovable_cmd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c index d540bce4e..f18ebaa08 100644 --- a/unmovable_cmd.c +++ b/unmovable_cmd.c @@ -195,7 +195,7 @@ static uint GetSlopeTileh_Unmovable(TileInfo *ti) static int32 ClearTile_Unmovable(TileIndex tile, byte flags) { - byte m5 = _map5[tile]; + byte m5 = _m[tile].m5; if (m5 & 0x80) { if (_current_player == OWNER_WATER) return DestroyCompanyHQ(tile, DC_EXEC); @@ -218,7 +218,7 @@ static int32 ClearTile_Unmovable(TileIndex tile, byte flags) static void GetAcceptedCargo_Unmovable(TileIndex tile, AcceptedCargo ac) { - byte m5 = _map5[tile]; + byte m5 = _m[tile].m5; uint level; // HQ level (depends on company performance) in the range 1..5. if (!(m5 & 0x80)) { @@ -252,7 +252,7 @@ static const StringID _unmovable_tile_str[] = { static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td) { - int i = _map5[tile]; + int i = _m[tile].m5; if (i & 0x80) i = -1; td->str = _unmovable_tile_str[i + 1]; td->owner = GetTileOwner(tile); @@ -265,7 +265,7 @@ static void AnimateTile_Unmovable(TileIndex tile) static void TileLoop_Unmovable(TileIndex tile) { - byte m5 = _map5[tile]; + byte m5 = _m[tile].m5; byte level; // HQ level (depends on company performance) in the range 1..5. uint32 r; @@ -307,7 +307,7 @@ static uint32 GetTileTrackStatus_Unmovable(TileIndex tile, TransportType mode) static void ClickTile_Unmovable(TileIndex tile) { - if (_map5[tile] & 0x80) { + if (_m[tile].m5 & 0x80) { ShowPlayerCompany(GetTileOwner(tile)); } } @@ -326,7 +326,7 @@ static bool checkRadioTowerNearby(TileIndex tile) BEGIN_TILE_LOOP(tile, 9, 9, tile_s) // already a radio tower here? - if (IsTileType(tile, MP_UNMOVABLE) && _map5[tile] == 0) + if (IsTileType(tile, MP_UNMOVABLE) && _m[tile].m5 == 0) return false; END_TILE_LOOP(tile, 9, 9, tile_s) return true; @@ -355,7 +355,7 @@ void GenerateUnmovables(void) if(!checkRadioTowerNearby(tile)) continue; SetTileType(tile, MP_UNMOVABLE); - _map5[tile] = 0; + _m[tile].m5 = 0; SetTileOwner(tile, OWNER_NONE); if (--j == 0) break; @@ -387,7 +387,7 @@ restart: assert(tile == TILE_MASK(tile)); SetTileType(tile, MP_UNMOVABLE); - _map5[tile] = 1; + _m[tile].m5 = 1; SetTileOwner(tile, OWNER_NONE); } while (--i); } @@ -396,7 +396,7 @@ static void ChangeTileOwner_Unmovable(TileIndex tile, byte old_player, byte new_ { if (!IsTileOwner(tile, old_player)) return; - if (_map5[tile]==3 && new_player != 255) { + if (_m[tile].m5==3 && new_player != 255) { SetTileOwner(tile, new_player); } else { DoClearSquare(tile); |