mirror of https://github.com/OpenTTD/OpenTTD
(svn r26102) -Fix: m_veh is not NULL by definition when IsRoadTT is true
parent
18beaac571
commit
e106e54f9f
|
@ -121,7 +121,7 @@ struct CFollowTrackT
|
||||||
m_old_tile = old_tile;
|
m_old_tile = old_tile;
|
||||||
m_old_td = old_td;
|
m_old_td = old_td;
|
||||||
m_err = EC_NONE;
|
m_err = EC_NONE;
|
||||||
assert(((TrackStatusToTrackdirBits(GetTileTrackStatus(m_old_tile, TT(), IsRoadTT() && m_veh != NULL ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
|
assert(((TrackStatusToTrackdirBits(GetTileTrackStatus(m_old_tile, TT(), IsRoadTT() ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0)) & TrackdirToTrackdirBits(m_old_td)) != 0) ||
|
||||||
(IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR)); // Disable the assertion for single tram bits
|
(IsTram() && GetSingleTramBit(m_old_tile) != INVALID_DIAGDIR)); // Disable the assertion for single tram bits
|
||||||
m_exitdir = TrackdirToExitdir(m_old_td);
|
m_exitdir = TrackdirToExitdir(m_old_td);
|
||||||
if (ForcedReverse()) return true;
|
if (ForcedReverse()) return true;
|
||||||
|
@ -233,7 +233,7 @@ protected:
|
||||||
if (IsRailTT() && IsPlainRailTile(m_new_tile)) {
|
if (IsRailTT() && IsPlainRailTile(m_new_tile)) {
|
||||||
m_new_td_bits = (TrackdirBits)(GetTrackBits(m_new_tile) * 0x101);
|
m_new_td_bits = (TrackdirBits)(GetTrackBits(m_new_tile) * 0x101);
|
||||||
} else {
|
} else {
|
||||||
m_new_td_bits = TrackStatusToTrackdirBits(GetTileTrackStatus(m_new_tile, TT(), IsRoadTT() && m_veh != NULL ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0));
|
m_new_td_bits = TrackStatusToTrackdirBits(GetTileTrackStatus(m_new_tile, TT(), IsRoadTT() ? RoadVehicle::From(m_veh)->compatible_roadtypes : 0));
|
||||||
|
|
||||||
if (IsTram() && m_new_td_bits == 0) {
|
if (IsTram() && m_new_td_bits == 0) {
|
||||||
/* GetTileTrackStatus() returns 0 for single tram bits.
|
/* GetTileTrackStatus() returns 0 for single tram bits.
|
||||||
|
|
Loading…
Reference in New Issue