diff options
author | tron <tron@openttd.org> | 2005-06-04 11:56:32 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-04 11:56:32 +0000 |
commit | 0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c (patch) | |
tree | 172ef15bca6626b797fbf586a043a978ee884141 /openttd.c | |
parent | 19e2b40a788cc175f35e4ca0cec0f439bd46ab76 (diff) | |
download | openttd-0c4ecbe9ece42d071a4f4e4b6d506be32030cb4c.tar.xz |
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
Diffstat (limited to 'openttd.c')
-rw-r--r-- | openttd.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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); } |