summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-04 11:56:32 +0000
committertron <tron@openttd.org>2005-06-04 11:56:32 +0000
commita9b95b3cbb397e5a644c8310d33d046b2737ce16 (patch)
tree172ef15bca6626b797fbf586a043a978ee884141 /openttd.c
parent6b3d3a0f8a89c3d9b2afef555277b9009fdb544e (diff)
downloadopenttd-a9b95b3cbb397e5a644c8310d33d046b2737ce16.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.c11
1 files changed, 6 insertions, 5 deletions
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);
}