diff --git a/src/vehicle.cpp b/src/vehicle.cpp --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -626,7 +626,7 @@ bool Vehicle::IsEngineCountable() const switch (this->type) { case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft(); // don't count plane shadows and helicopter rotors case VEH_TRAIN: - return !Train::From(this)->IsArticulatedPart() && // tenders and other articulated parts + return !this->IsArticulatedPart() && // tenders and other articulated parts !Train::From(this)->IsRearDualheaded(); // rear parts of multiheaded engines case VEH_ROAD: return RoadVehicle::From(this)->IsFrontEngine(); case VEH_SHIP: return true; @@ -1538,7 +1538,7 @@ LiveryScheme GetEngineLiveryScheme(Engin switch (e->type) { default: NOT_REACHED(); case VEH_TRAIN: - if (v != NULL && parent_engine_type != INVALID_ENGINE && (UsesWagonOverride(v) || (Train::From(v)->IsArticulatedPart() && e->u.rail.railveh_type != RAILVEH_WAGON))) { + if (v != NULL && parent_engine_type != INVALID_ENGINE && (UsesWagonOverride(v) || (v->IsArticulatedPart() && e->u.rail.railveh_type != RAILVEH_WAGON))) { /* Wagonoverrides use the colour scheme of the front engine. * Articulated parts use the colour scheme of the first part. (Not supported for articulated wagons) */ engine_type = parent_engine_type;