diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2018-10-27 18:13:42 +0100 |
---|---|---|
committer | frosch <github@elsenhans.name> | 2018-10-31 12:41:49 +0100 |
commit | bb7353c02afd7ff04c4a71cc2b114ed8a6136994 (patch) | |
tree | dba608b5d6b84ed30a90a7d9f46c8f565c4efb8d /src/pathfinder/follow_track.hpp | |
parent | 1778b2d66ec21e544e56e5aaaee816cf8fc955af (diff) | |
download | openttd-bb7353c02afd7ff04c4a71cc2b114ed8a6136994.tar.xz |
Codechange: Some more null checks
Diffstat (limited to 'src/pathfinder/follow_track.hpp')
-rw-r--r-- | src/pathfinder/follow_track.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp index 70f148de3..0aec3951e 100644 --- a/src/pathfinder/follow_track.hpp +++ b/src/pathfinder/follow_track.hpp @@ -124,8 +124,12 @@ struct CFollowTrackT m_old_tile = old_tile; m_old_td = old_td; m_err = EC_NONE; - 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 + assert( + ((TrackStatusToTrackdirBits( + GetTileTrackStatus(m_old_tile, TT(), (IsRoadTT() && m_veh != NULL) ? 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 + ); m_exitdir = TrackdirToExitdir(m_old_td); if (ForcedReverse()) return true; if (!CanExitOldTile()) return false; |