equal
deleted
inserted
replaced
43 * Otherwise returns false if track can't be followed. */ |
43 * Otherwise returns false if track can't be followed. */ |
44 FORCEINLINE bool Follow(TileIndex old_tile, Trackdir old_td) |
44 FORCEINLINE bool Follow(TileIndex old_tile, Trackdir old_td) |
45 { |
45 { |
46 m_old_tile = old_tile; |
46 m_old_tile = old_tile; |
47 m_old_td = old_td; |
47 m_old_td = old_td; |
48 assert((GetTileTrackStatus(m_old_tile, TT()) & TrackdirToTrackdirBits(m_old_td)) != 0); |
48 assert((GetTileTrackStatus(m_old_tile, TT(), m_veh->u.road.compatible_roadtypes) & TrackdirToTrackdirBits(m_old_td)) != 0); |
49 m_exitdir = TrackdirToExitdir(m_old_td); |
49 m_exitdir = TrackdirToExitdir(m_old_td); |
50 if (EnteredDepot()) return true; |
50 if (EnteredDepot()) return true; |
51 if (!CanExitOldTile()) return false; |
51 if (!CanExitOldTile()) return false; |
52 FollowTileExit(); |
52 FollowTileExit(); |
53 if (!QueryNewTileTrackStatus()) return TryReverse(); |
53 if (!QueryNewTileTrackStatus()) return TryReverse(); |
112 { |
112 { |
113 CPerfStart perf(*m_pPerf); |
113 CPerfStart perf(*m_pPerf); |
114 if (IsRailTT() && GetTileType(m_new_tile) == MP_RAILWAY && IsPlainRailTile(m_new_tile)) { |
114 if (IsRailTT() && GetTileType(m_new_tile) == MP_RAILWAY && IsPlainRailTile(m_new_tile)) { |
115 m_new_td_bits = (TrackdirBits)(GetTrackBits(m_new_tile) * 0x101); |
115 m_new_td_bits = (TrackdirBits)(GetTrackBits(m_new_tile) * 0x101); |
116 } else { |
116 } else { |
117 uint32 ts = GetTileTrackStatus(m_new_tile, TT()); |
117 uint32 ts = GetTileTrackStatus(m_new_tile, TT(), m_veh->u.road.compatible_roadtypes); |
118 m_new_td_bits = (TrackdirBits)(ts & TRACKDIR_BIT_MASK); |
118 m_new_td_bits = (TrackdirBits)(ts & TRACKDIR_BIT_MASK); |
119 } |
119 } |
120 return (m_new_td_bits != TRACKDIR_BIT_NONE); |
120 return (m_new_td_bits != TRACKDIR_BIT_NONE); |
121 } |
121 } |
122 |
122 |