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

Function TrainOnCrossing

src/train_cmd.cpp:1702–1707  ·  view source on GitHub ↗

* Check if a level crossing tile has a train on it * @param tile tile to test * @return true if a train is on the crossing * @pre tile is a level crossing */

Source from the content-addressed store, hash-verified

1700 * @pre tile is a level crossing
1701 */
1702bool TrainOnCrossing(TileIndex tile)
1703{
1704 assert(IsLevelCrossingTile(tile));
1705
1706 return HasVehicleOnTile(tile, IsTrain);
1707}
1708
1709/**
1710 * Checks if a train is approaching a rail-road crossing

Callers 2

CheckLevelCrossingFunction · 0.85
GetTileTrackStatus_RoadFunction · 0.85

Calls 2

IsLevelCrossingTileFunction · 0.85
HasVehicleOnTileFunction · 0.85

Tested by

no test coverage detected