(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner

This commit is contained in:
tron
2005-06-04 11:56:32 +00:00
parent 19e2b40a78
commit 0c4ecbe9ec
25 changed files with 118 additions and 122 deletions

View File

@@ -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);
}