From 72cd855978bf45fd444eae72551a12e13a35b0c8 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 1 Nov 2011 00:21:08 +0000 Subject: (svn r23074) -Codechange: Add Vehicle::GetEngine() to simplify code. --- src/vehicle_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vehicle_gui.cpp') diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index c3cc8dade..2475b9b1b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -217,8 +217,8 @@ static const uint MAX_REFIT_CYCLE = 256; */ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for) { - const Engine *e_from = Engine::Get(v_from->engine_type); - const Engine *e_for = Engine::Get(v_for->engine_type); + const Engine *e_from = v_from->GetEngine(); + const Engine *e_for = v_for->GetEngine(); /* If one them doesn't carry cargo, there's no need to find a sub type */ if (!e_from->CanCarryCargo() || !e_for->CanCarryCargo()) return 0; @@ -386,7 +386,7 @@ struct RefitWindow : public Window { do { if (v->type == VEH_TRAIN && !vehicles_to_refit.Contains(v->index)) continue; - const Engine *e = Engine::Get(v->engine_type); + const Engine *e = v->GetEngine(); uint32 cmask = e->info.refit_mask; byte callback_mask = e->info.callback_mask; -- cgit v1.2.3-54-g00ecf