rail.h
changeset 4281 810f2fb02a10
parent 4158 91ff9bb84ced
child 4344 7e123fec5b0b
equal deleted inserted replaced
4280:90e7b2ea8627 4281:810f2fb02a10
   294  * Discards all directional information from the given TrackdirBits. Any
   294  * Discards all directional information from the given TrackdirBits. Any
   295  * Track which is present in either direction will be present in the result.
   295  * Track which is present in either direction will be present in the result.
   296  */
   296  */
   297 static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits)
   297 static inline TrackBits TrackdirBitsToTrackBits(TrackdirBits bits)
   298 {
   298 {
   299 	return (TrackBits)(bits | (bits >> 8));
   299 	return (TrackBits)((bits | (bits >> 8)) & TRACK_BIT_MASK);
   300 }
   300 }
   301 
   301 
   302 /**
   302 /**
   303  * Maps a trackdir to the trackdir that you will end up on if you go straight
   303  * Maps a trackdir to the trackdir that you will end up on if you go straight
   304  * ahead. This will be the same trackdir for diagonal trackdirs, but a
   304  * ahead. This will be the same trackdir for diagonal trackdirs, but a