summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2007-12-16 19:30:42 +0000
committersmatz <smatz@openttd.org>2007-12-16 19:30:42 +0000
commit145517fb8e0bbd66daa711ca2b31aecc0179fe74 (patch)
tree3d93af5bbe577ea3e66b1184cb89c1a934d6bcda /src/ai
parent0730b9afc135eabce02144e2928b86cfa0b7f95e (diff)
downloadopenttd-145517fb8e0bbd66daa711ca2b31aecc0179fe74.tar.xz
(svn r11649) -Codechange: some code can be simplified thanks to changes in r11642
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/trolly/pathfinder.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp
index 33383a560..bfd4a0799 100644
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -45,10 +45,7 @@ static bool IsRoad(TileIndex tile)
return
// MP_ROAD, but not a road depot?
(IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
- (IsTileType(tile, MP_TUNNELBRIDGE) && (
- (IsTunnel(tile) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD) ||
- (IsBridge(tile) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD)
- ));
+ (IsTileType(tile, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD);
}
@@ -236,11 +233,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// If the next step is a bridge, we have to enter it the right way
if (!PathFinderInfo->rail_or_road && IsRoad(atile)) {
if (IsTileType(atile, MP_TUNNELBRIDGE)) {
- if (IsTunnel(atile)) {
- if (GetTunnelBridgeDirection(atile) != i) continue;
- } else {
- if (GetTunnelBridgeDirection(atile) != i) continue;
- }
+ if (GetTunnelBridgeDirection(atile) != i) continue;
}
}