MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / TrackToOppositeTrack

Function TrackToOppositeTrack

src/track_func.h:231–235  ·  view source on GitHub ↗

* Find the opposite track to a given track. * * TRACK_LOWER -> TRACK_UPPER and vice versa, likewise for left/right. * TRACK_X is mapped to TRACK_Y and reversed. * * @param t the track to convert * @return the opposite track */

Source from the content-addressed store, hash-verified

229 * @return the opposite track
230 */
231inline Track TrackToOppositeTrack(Track t)
232{
233 assert(IsValidTrack(t));
234 return (Track)(t ^ 1);
235}
236
237/**
238 * Maps a trackdir to the reverse trackdir.

Callers 2

ChooseShipTrackFunction · 0.85

Calls 1

IsValidTrackFunction · 0.85

Tested by

no test coverage detected