summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-07-17 15:38:51 +0000
committerfrosch <frosch@openttd.org>2010-07-17 15:38:51 +0000
commitf87e9c21f278be4f1c4b97715b39936d8dfbb32c (patch)
treeb1ac45c934ec32f7f95f12fc19875b6c5a1b1b46 /src
parentec4fa160e9c8f96f663515265734255b42bcdd65 (diff)
downloadopenttd-f87e9c21f278be4f1c4b97715b39936d8dfbb32c.tar.xz
(svn r20175) -Change: [NewGRF] Adapt vehicle var FE bit 6 to new railtypes.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index e6f4105a7..2caf89de1 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -673,11 +673,10 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
const Train *u = t->IsWagon() && HasBit(t->vehicle_flags, VRF_POWEREDWAGON) ? t->First() : t;
RailType railtype = GetRailType(v->tile);
bool powered = t->IsEngine() || (t->IsWagon() && HasBit(t->vehicle_flags, VRF_POWEREDWAGON));
- bool has_power = powered && HasPowerOnRail(u->railtype, railtype);
- bool is_electric = powered && u->railtype == RAILTYPE_ELECTRIC;
+ bool has_power = HasPowerOnRail(u->railtype, railtype);
- if (has_power) SetBit(modflags, 5);
- if (is_electric && !has_power) SetBit(modflags, 6);
+ if (powered && has_power) SetBit(modflags, 5);
+ if (powered && !has_power) SetBit(modflags, 6);
if (HasBit(t->flags, VRF_TOGGLE_REVERSE)) SetBit(modflags, 8);
}
if (HasBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE)) SetBit(modflags, 10);