pathfind.c
changeset 1901 fb05044cf5c3
parent 1891 92a3b0aa0946
child 1977 4392ae3d8e31
--- a/pathfind.c	Sat Jun 04 07:36:28 2005 +0000
+++ b/pathfind.c	Sat Jun 04 11:56:32 2005 +0000
@@ -133,7 +133,7 @@
 
 	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 @@
 		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 @@
 				/* 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;
 	}