changeset 15824:5ca623849e16 draft

(svn r20503) -Fix (r18838): Powered wagons should check the railtype of the tile they are on, not where the engine is on.
author frosch <frosch@openttd.org>
date Sun, 15 Aug 2010 18:35:57 +0000
parents d9032e02c0c5
children 5a7d7a33055b
files src/train.h
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/train.h
+++ b/src/train.h
@@ -395,7 +395,8 @@
 	 */
 	FORCEINLINE uint16 GetPoweredPartPower(const Train *head) const
 	{
-		if (HasBit(this->flags, VRF_POWEREDWAGON) && HasPowerOnRail(head->railtype, GetRailType(head->tile))) {
+		/* 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))) {
 			return RailVehInfo(this->tcache.first_engine)->pow_wag_power;
 		}