diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 22:22:46 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 22:22:46 +0000 |
commit | 80e94b9bb15f846189e98f1f457afe2b96ba2b58 (patch) | |
tree | b623c3e1cc75771986452340a138bd3ac60d4cbc /src/ai/api | |
parent | 7a37220881c995f317bf5bd0f3077fa6c9e9d098 (diff) | |
download | openttd-80e94b9bb15f846189e98f1f457afe2b96ba2b58.tar.xz |
(svn r16391) -Codechange: use Train instead of Vehicle where appropriate.
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_vehicle.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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; } |