summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-01 00:21:08 +0000
committerfrosch <frosch@openttd.org>2011-11-01 00:21:08 +0000
commit72cd855978bf45fd444eae72551a12e13a35b0c8 (patch)
treeb7f4b3cc07022ba32160f5e67f4cb5a527266d12 /src/vehicle_cmd.cpp
parentc366e0d45f87f9ba625ed73cbf5bff61d8483c5c (diff)
downloadopenttd-72cd855978bf45fd444eae72551a12e13a35b0c8.tar.xz
(svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code.
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 22ebef2fb..48d8e42bb 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -273,7 +273,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles,
for (; v != NULL; v = (only_this ? NULL : v->Next())) {
if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index) && !only_this) continue;
- const Engine *e = Engine::Get(v->engine_type);
+ const Engine *e = v->GetEngine();
if (!e->CanCarryCargo()) continue;
/* If the vehicle is not refittable, count its capacity nevertheless if the cargo matches */
@@ -789,7 +789,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
break;
}
} else {
- const Engine *e = Engine::Get(v->engine_type);
+ const Engine *e = v->GetEngine();
CargoID initial_cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : (CargoID)CT_INVALID);
if (v->cargo_type != initial_cargo && initial_cargo != CT_INVALID) {