equal
deleted
inserted
replaced
412 * Gets the state of the signal along the given trackdir. |
412 * Gets the state of the signal along the given trackdir. |
413 * |
413 * |
414 * Along meaning if you are currently driving on the given trackdir, this is |
414 * Along meaning if you are currently driving on the given trackdir, this is |
415 * the signal that is facing us (for which we stop when it's red). |
415 * the signal that is facing us (for which we stop when it's red). |
416 */ |
416 */ |
417 static inline SignalState GetSignalState(TileIndex tile, Trackdir trackdir) |
417 static inline SignalState GetSignalStateByTrackdir(TileIndex tile, Trackdir trackdir) |
418 { |
418 { |
419 assert(IsValidTrackdir(trackdir)); |
419 assert(IsValidTrackdir(trackdir)); |
420 assert(HasSignalOnTrack(tile, TrackdirToTrack(trackdir))); |
420 assert(HasSignalOnTrack(tile, TrackdirToTrack(trackdir))); |
421 return _m[tile].m2 & SignalAlongTrackdir(trackdir) ? |
421 return _m[tile].m2 & SignalAlongTrackdir(trackdir) ? |
422 SIGNAL_STATE_GREEN : SIGNAL_STATE_RED; |
422 SIGNAL_STATE_GREEN : SIGNAL_STATE_RED; |