(svn r11802) -Fix [FS#716]: do not crash trains when leaving depot to a very long track

-Codechange: use dedicated pathfinder for signal updating, resulting in better performance and possible future improvements
This commit is contained in:
smatz
2008-01-09 23:00:59 +00:00
parent c004cc1fd9
commit bc4ed3eafd
16 changed files with 643 additions and 244 deletions

View File

@@ -375,6 +375,18 @@ static inline SignalState GetSignalStateByTrackdir(TileIndex tile, Trackdir trac
SIGNAL_STATE_GREEN : SIGNAL_STATE_RED;
}
/**
* Sets the state of the signal along the given trackdir.
*/
static inline void SetSignalStateByTrackdir(TileIndex tile, Trackdir trackdir, SignalState state)
{
if (state == SIGNAL_STATE_GREEN) { // set 1
SetSignalStates(tile, GetSignalStates(tile) | SignalAlongTrackdir(trackdir));
} else {
SetSignalStates(tile, GetSignalStates(tile) & ~SignalAlongTrackdir(trackdir));
}
}
/**
* Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile.