(svn r13223) [NoAI] -Fix (r13212): tunnels and bridges were not tram aware noai
authorglx
Fri, 23 May 2008 16:19:13 +0000
branchnoai
changeset 10679 fcd493243794
parent 10676 9dca9483f2c0
child 10691 a60393d87c0b
(svn r13223) [NoAI] -Fix (r13212): tunnels and bridges were not tram aware
src/ai/api/ai_bridge.cpp
src/ai/api/ai_tunnel.cpp
--- a/src/ai/api/ai_bridge.cpp	Fri May 23 09:46:39 2008 +0000
+++ b/src/ai/api/ai_bridge.cpp	Fri May 23 16:19:13 2008 +0000
@@ -32,7 +32,7 @@
 	uint type = 0;
 	if (vehicle_type == AIVehicle::VEHICLE_ROAD) {
 		type |= (TRANSPORT_ROAD << 15);
-		type |= (ROADTYPES_ROAD << 8);
+		type |= (RoadTypeToRoadTypes((::RoadType)AIObject::GetRoadType()) << 8);
 	} else {
 		type |= (TRANSPORT_RAIL << 15);
 		type |= (RAILTYPES_RAIL << 8);
--- a/src/ai/api/ai_tunnel.cpp	Fri May 23 09:46:39 2008 +0000
+++ b/src/ai/api/ai_tunnel.cpp	Fri May 23 16:19:13 2008 +0000
@@ -10,6 +10,7 @@
 #include "../../road_type.h"
 #include "../../command_func.h"
 #include "../../tunnelbridge.h"
+#include "../../road_func.h"
 
 /* static */ bool AITunnel::IsTunnelTile(TileIndex tile)
 {
@@ -35,7 +36,7 @@
 	uint type = 0;
 	if (vehicle_type == AIVehicle::VEHICLE_ROAD) {
 		type |= (TRANSPORT_ROAD << 9);
-		type |= ROADTYPES_ROAD;
+		type |= RoadTypeToRoadTypes((::RoadType)AIObject::GetRoadType());
 	} else {
 		type |= (TRANSPORT_RAIL << 9);
 		type |= RAILTYPES_RAIL;