summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-22 22:33:05 +0000
committerrubidium <rubidium@openttd.org>2009-05-22 22:33:05 +0000
commitc4b627af422075ce4a0e1026c52f871dd3f146c0 (patch)
treefebaea249dc307b4b619aeff09e353677bbbcd84 /src/newgrf_engine.cpp
parent80e94b9bb15f846189e98f1f457afe2b96ba2b58 (diff)
downloadopenttd-c4b627af422075ce4a0e1026c52f871dd3f146c0.tar.xz
(svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index dd971f7f1..63ee47c4c 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -672,12 +672,12 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
const Train *u = IsTrainWagon(v) && HasBit(v->vehicle_flags, VRF_POWEREDWAGON) ? t->First() : t;
RailType railtype = GetRailType(v->tile);
bool powered = IsTrainEngine(v) || (IsTrainWagon(v) && HasBit(v->vehicle_flags, VRF_POWEREDWAGON));
- bool has_power = powered && HasPowerOnRail(u->u.rail.railtype, railtype);
- bool is_electric = powered && u->u.rail.railtype == RAILTYPE_ELECTRIC;
+ bool has_power = powered && HasPowerOnRail(u->railtype, railtype);
+ bool is_electric = powered && u->railtype == RAILTYPE_ELECTRIC;
if (has_power) SetBit(modflags, 5);
if (is_electric && !has_power) SetBit(modflags, 6);
- if (HasBit(t->u.rail.flags, VRF_TOGGLE_REVERSE)) SetBit(modflags, 8);
+ if (HasBit(t->flags, VRF_TOGGLE_REVERSE)) SetBit(modflags, 8);
}
if (HasBit(v->vehicle_flags, VF_BUILT_AS_PROTOTYPE)) SetBit(modflags, 10);
@@ -736,7 +736,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case 0x47: return GB(Engine::Get(v->engine_type)->internal_id, 8, 8);
case 0x48:
if (v->type != VEH_TRAIN || v->spritenum != 0xFD) return v->spritenum;
- return HasBit(((Train *)v)->u.rail.flags, VRF_REVERSE_DIRECTION) ? 0xFE : 0xFD;
+ return HasBit(((Train *)v)->flags, VRF_REVERSE_DIRECTION) ? 0xFE : 0xFD;
case 0x49: return v->day_counter;
case 0x4A: return v->breakdowns_since_last_service;
@@ -770,8 +770,8 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
case VEH_TRAIN: {
Train *t = (Train *)v;
switch (variable - 0x80) {
- case 0x62: return t->u.rail.track;
- case 0x66: return t->u.rail.railtype;
+ case 0x62: return t->track;
+ case 0x66: return t->railtype;
case 0x73: return t->u.rail.cached_veh_length;
case 0x74: return t->u.rail.cached_power;
case 0x75: return GB(t->u.rail.cached_power, 8, 24);