TBTR: Assume that virtual vehicles are on a suitably powered railtype.
This commit is contained in:
		@@ -197,7 +197,7 @@ protected: // These functions should not be called outside acceleration code.
 | 
				
			|||||||
	inline uint16 GetPower() const
 | 
						inline uint16 GetPower() const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		/* Power is not added for articulated parts */
 | 
							/* 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);
 | 
								uint16 power = GetVehicleProperty(this, PROP_TRAIN_POWER, RailVehInfo(this->engine_type)->power);
 | 
				
			||||||
			/* Halve power for multiheaded parts */
 | 
								/* Halve power for multiheaded parts */
 | 
				
			||||||
			if (this->IsMultiheaded()) power /= 2;
 | 
								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
 | 
						inline uint16 GetPoweredPartPower(const Train *head) const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		/* For powered wagons the engine defines the type of engine (i.e. railtype) */
 | 
							/* 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;
 | 
								return RailVehInfo(this->gcache.first_engine)->pow_wag_power;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user