TBTR: Assume that virtual vehicles are on a suitably powered railtype.

This commit is contained in:
Jonathan G Rennison
2017-02-28 19:32:29 +00:00
parent 120fcf995d
commit 939a350864

View File

@@ -197,7 +197,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;
@@ -214,7 +214,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;
}