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

Function CheckLevelCrossing

src/train_cmd.cpp:1756–1760  ·  view source on GitHub ↗

* Check if a level crossing should be barred. * @param tile The tile to check. * @return True if the crossing should be barred, else false. */

Source from the content-addressed store, hash-verified

1754 * @return True if the crossing should be barred, else false.
1755 */
1756static inline bool CheckLevelCrossing(TileIndex tile)
1757{
1758 /* reserved || train on crossing || train approaching crossing */
1759 return HasCrossingReservation(tile) || TrainOnCrossing(tile) || TrainApproachingCrossing(tile);
1760}
1761
1762/**
1763 * Sets a level crossing tile to the correct state.

Calls 3

HasCrossingReservationFunction · 0.85
TrainOnCrossingFunction · 0.85
TrainApproachingCrossingFunction · 0.85

Tested by

no test coverage detected