summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 20:22:20 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 20:22:20 +0000
commit7a37220881c995f317bf5bd0f3077fa6c9e9d098 (patch)
tree347d24d175af30acacfedfb4ddf5c9e98d876036 /src/ai
parentd37b840cf30ea987ab676f1a3631e112cac06244 (diff)
downloadopenttd-7a37220881c995f317bf5bd0f3077fa6c9e9d098.tar.xz
(svn r16390) -Codechange: move u.road to RoadVehicle.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/api/ai_vehicle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index 3e30601fe..fa324200a 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -45,7 +45,7 @@
case VEH_ROAD: {
uint total_length = 0;
for (const Vehicle *u = v; u != NULL; u = u->Next()) {
- total_length += u->u.road.cached_veh_length;
+ total_length += ((RoadVehicle*)u)->cached_veh_length;
}
return total_length;
}
@@ -368,7 +368,7 @@
if (!IsValidVehicle(vehicle_id)) return AIRoad::ROADTYPE_INVALID;
if (GetVehicleType(vehicle_id) != VT_ROAD) return AIRoad::ROADTYPE_INVALID;
- return (AIRoad::RoadType)::Vehicle::Get(vehicle_id)->u.road.roadtype;
+ return (AIRoad::RoadType)((RoadVehicle*)::Vehicle::Get(vehicle_id))->roadtype;
}
/* static */ int32 AIVehicle::GetCapacity(VehicleID vehicle_id, CargoID cargo)