rail.h
changeset 3520 a288391e66a3
parent 3503 44f50afb0a75
child 3575 f5b56bd958c0
equal deleted inserted replaced
3519:1b8eb174e528 3520:a288391e66a3
   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;