From 80e94b9bb15f846189e98f1f457afe2b96ba2b58 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 22 May 2009 22:22:46 +0000 Subject: (svn r16391) -Codechange: use Train instead of Vehicle where appropriate. --- src/ai/api/ai_vehicle.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ai/api/ai_vehicle.cpp') diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp index fa324200a..baeeaefa5 100644 --- a/src/ai/api/ai_vehicle.cpp +++ b/src/ai/api/ai_vehicle.cpp @@ -29,7 +29,7 @@ int num = 1; if (::Vehicle::Get(vehicle_id)->type == VEH_TRAIN) { - const Vehicle *v = ::Vehicle::Get(vehicle_id); + const Train *v = (Train *)::Vehicle::Get(vehicle_id); while ((v = GetNextUnit(v)) != NULL) num++; } @@ -85,11 +85,11 @@ EnforcePrecondition(false, ::Vehicle::Get(source_vehicle_id)->type == VEH_TRAIN); EnforcePrecondition(false, dest_vehicle_id == -1 || ::Vehicle::Get(dest_vehicle_id)->type == VEH_TRAIN); - const Vehicle *v = ::Vehicle::Get(source_vehicle_id); + const Train *v = (Train *)::Vehicle::Get(source_vehicle_id); while (source_wagon-- > 0) v = GetNextUnit(v); - const Vehicle *w = NULL; + const Train *w = NULL; if (dest_vehicle_id != -1) { - w = ::Vehicle::Get(dest_vehicle_id); + w = (Train *)::Vehicle::Get(dest_vehicle_id); while (dest_wagon-- > 0) w = GetNextUnit(w); } @@ -136,7 +136,7 @@ EnforcePrecondition(false, IsValidVehicle(vehicle_id) && wagon < GetNumWagons(vehicle_id)); EnforcePrecondition(false, ::Vehicle::Get(vehicle_id)->type == VEH_TRAIN); - const Vehicle *v = ::Vehicle::Get(vehicle_id); + const Train *v = (Train *)::Vehicle::Get(vehicle_id); while (wagon-- > 0) v = GetNextUnit(v); return AIObject::DoCommand(0, v->index, sell_attached_wagons ? 1 : 0, CMD_SELL_RAIL_WAGON); @@ -243,7 +243,7 @@ const Vehicle *v = ::Vehicle::Get(vehicle_id); if (v->type == VEH_TRAIN) { - while (wagon-- > 0) v = GetNextUnit(v); + while (wagon-- > 0) v = GetNextUnit((Train *)v); } return v->engine_type; } @@ -281,7 +281,7 @@ const Vehicle *v = ::Vehicle::Get(vehicle_id); if (v->type == VEH_TRAIN) { - while (wagon-- > 0) v = GetNextUnit(v); + while (wagon-- > 0) v = GetNextUnit((Train *)v); } return v->age; } -- cgit v1.2.3-54-g00ecf