diff --git a/src/train.h b/src/train.h index 3173b03567..536083b401 100644 --- a/src/train.h +++ b/src/train.h @@ -229,7 +229,7 @@ protected: // These functions should not be called outside acceleration code. inline uint16 GetPower() const { /* Power is not added for articulated parts */ - if (!this->IsArticulatedPart() && HasPowerOnRail(this->railtype, GetRailType(this->tile))) { + if (!this->IsArticulatedPart() && (this->IsVirtual() || HasPowerOnRail(this->railtype, GetRailType(this->tile)))) { uint16 power = GetVehicleProperty(this, PROP_TRAIN_POWER, RailVehInfo(this->engine_type)->power); /* Halve power for multiheaded parts */ if (this->IsMultiheaded()) power /= 2; @@ -246,7 +246,7 @@ protected: // These functions should not be called outside acceleration code. inline uint16 GetPoweredPartPower(const Train *head) const { /* For powered wagons the engine defines the type of engine (i.e. railtype) */ - if (HasBit(this->flags, VRF_POWEREDWAGON) && HasPowerOnRail(head->railtype, GetRailType(this->tile))) { + if (HasBit(this->flags, VRF_POWEREDWAGON) && (head->IsVirtual() || HasPowerOnRail(head->railtype, GetRailType(this->tile)))) { return RailVehInfo(this->gcache.first_engine)->pow_wag_power; }