summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/follow_track.hpp2
-rw-r--r--src/yapf/yapf_destrail.hpp4
-rw-r--r--src/yapf/yapf_rail.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/yapf/follow_track.hpp b/src/yapf/follow_track.hpp
index a0f9dc37c..0263150fe 100644
--- a/src/yapf/follow_track.hpp
+++ b/src/yapf/follow_track.hpp
@@ -55,7 +55,7 @@ struct CFollowTrackT
{
assert(!IsRailTT() || (v != NULL && v->type == VEH_TRAIN));
m_veh = v;
- Init(v != NULL ? v->owner : INVALID_OWNER, railtype_override == INVALID_RAILTYPES ? ((Train *)v)->u.rail.compatible_railtypes : railtype_override, pPerf);
+ Init(v != NULL ? v->owner : INVALID_OWNER, railtype_override == INVALID_RAILTYPES ? ((Train *)v)->compatible_railtypes : railtype_override, pPerf);
}
FORCEINLINE void Init(Owner o, RailTypes railtype_override, CPerformanceTimer *pPerf)
diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp
index fbdac4a71..99aa4ea48 100644
--- a/src/yapf/yapf_destrail.hpp
+++ b/src/yapf/yapf_destrail.hpp
@@ -13,8 +13,8 @@ protected:
public:
void SetDestination(const Vehicle *v, bool override_rail_type = false)
{
- m_compatible_railtypes = v->u.rail.compatible_railtypes;
- if (override_rail_type) m_compatible_railtypes |= GetRailTypeInfo(v->u.rail.railtype)->compatible_railtypes;
+ m_compatible_railtypes = ((Train *)v)->compatible_railtypes;
+ if (override_rail_type) m_compatible_railtypes |= GetRailTypeInfo(((Train *)v)->railtype)->compatible_railtypes;
}
bool IsCompatibleRailType(RailType rt)
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp
index 2c05c68ff..7b4e4e9bb 100644
--- a/src/yapf/yapf_rail.cpp
+++ b/src/yapf/yapf_rail.cpp
@@ -550,7 +550,7 @@ bool YapfCheckReverseTrain(const Vehicle *vt)
int reverse_penalty = 0;
- if (v->u.rail.track == TRACK_BIT_WORMHOLE) {
+ if (v->track == TRACK_BIT_WORMHOLE) {
/* front in tunnel / on bridge */
DiagDirection dir_into_wormhole = GetTunnelBridgeDirection(tile);
@@ -565,7 +565,7 @@ bool YapfCheckReverseTrain(const Vehicle *vt)
reverse_penalty -= DistanceManhattan(cur_tile, tile) * YAPF_TILE_LENGTH;
}
- if (last_veh->u.rail.track == TRACK_BIT_WORMHOLE) {
+ if (last_veh->track == TRACK_BIT_WORMHOLE) {
/* back in tunnel / on bridge */
DiagDirection dir_into_wormhole = GetTunnelBridgeDirection(tile_rev);