summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-15 18:35:57 +0000
committerfrosch <frosch@openttd.org>2010-08-15 18:35:57 +0000
commit4ca2609362572ec218a7e9e05b9f9bdb76900b6e (patch)
tree9bafbc2569274bbcf4f1d3a4bba662d4e03bee92 /src/train.h
parentc52f42ea21bfc76e48a9ef93f721aa47376c474a (diff)
downloadopenttd-4ca2609362572ec218a7e9e05b9f9bdb76900b6e.tar.xz
(svn r20503) -Fix (r18838): Powered wagons should check the railtype of the tile they are on, not where the engine is on.
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/train.h b/src/train.h
index 6cb7e5888..40c340328 100644
--- a/src/train.h
+++ b/src/train.h
@@ -395,7 +395,8 @@ protected: // These functions should not be called outside acceleration code.
*/
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;
}