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 /pathfind.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 'pathfind.c')
-rw-r--r-- | pathfind.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pathfind.c b/pathfind.c index c8b75ed15..99eb050a5 100644 --- a/pathfind.c +++ b/pathfind.c @@ -133,7 +133,7 @@ static void TPFMode2(TrackPathFinder *tpf, uint tile, int direction) if (tpf->tracktype == TRANSPORT_RAIL) { if (IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_STATION) || IsTileType(tile, MP_TUNNELBRIDGE)) { - owner = _map_owner[tile]; + owner = GetTileOwner(tile); /* Check if we are on the middle of a bridge (has no owner) */ if (IsTileType(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xC0) == 0xC0) owner = -1; @@ -150,7 +150,7 @@ static void TPFMode2(TrackPathFinder *tpf, uint tile, int direction) if (IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_STATION) || IsTileType(tile, MP_TUNNELBRIDGE)) /* Check if we are on the middle of a bridge (has no owner) */ if (!IsTileType(tile, MP_TUNNELBRIDGE) || (_map5[tile] & 0xC0) != 0xC0) - if (owner != -1 && _map_owner[tile] != owner) + if (owner != -1 && !IsTileOwner(tile, owner)) return; } @@ -296,7 +296,7 @@ static void TPFMode1(TrackPathFinder *tpf, uint tile, int direction) /* Check if we are on a bridge (middle parts don't have an owner */ if (!IsTileType(tile, MP_TUNNELBRIDGE) || (_map5[tile] & 0xC0) != 0xC0) if (!IsTileType(tile_org, MP_TUNNELBRIDGE) || (_map5[tile_org] & 0xC0) != 0xC0) - if (_map_owner[tile_org] != _map_owner[tile]) + if (GetTileOwner(tile_org) != GetTileOwner(tile)) return; } |