From a9b95b3cbb397e5a644c8310d33d046b2737ce16 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 4 Jun 2005 11:56:32 +0000 Subject: (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner --- openttd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'openttd.c') diff --git a/openttd.c b/openttd.c index 619c964f8..ffd159aa3 100644 --- a/openttd.c +++ b/openttd.c @@ -1299,7 +1299,7 @@ bool AfterLoadGame(uint version) uint h = MapSizeY(); BEGIN_TILE_LOOP(tile_cur, w, h, tile) - if (IsTileType(tile_cur, MP_WATER) && _map_owner[tile_cur] >= MAX_PLAYERS) + if (IsTileType(tile_cur, MP_WATER) && GetTileOwner(tile_cur) >= MAX_PLAYERS) _map_owner[tile_cur] = OWNER_WATER; END_TILE_LOOP(tile_cur, w, h, tile) } @@ -1393,13 +1393,14 @@ bool AfterLoadGame(uint version) SetTileType(tile, MP_HOUSE); } else if (IsTileType(tile, MP_STREET)) { //XXX magic - SetTileType(tile, MP_VOID); _map3_hi[tile] |= (_map2[tile] << 4); - if ( _map_owner[tile] == OWNER_TOWN) + if (IsTileOwner(tile, OWNER_TOWN)) { + SetTileType(tile, MP_VOID); _map2[tile] = ClosestTownFromTile(tile,(uint)-1)->index; - else + SetTileType(tile, MP_STREET); + } else { _map2[tile] = 0; - SetTileType(tile, MP_STREET); + } } } END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0); } -- cgit v1.2.3-54-g00ecf