forked from mirror/OpenTTD
(svn r16392) -Codechange: move some variables (the ones that aren't caches) from VehicleRail to Train
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user