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

Function MaybeBarCrossingWithSound

src/train_cmd.cpp:1878–1884  ·  view source on GitHub ↗

* Bars crossing and plays ding-ding sound if not barred already * @param tile tile with crossing * @pre tile is a rail-road crossing */

Source from the content-addressed store, hash-verified

1876 * @pre tile is a rail-road crossing
1877 */
1878static inline void MaybeBarCrossingWithSound(TileIndex tile)
1879{
1880 if (!IsCrossingBarred(tile)) {
1881 SetCrossingReservation(tile, true);
1882 UpdateLevelCrossing(tile, true);
1883 }
1884}
1885
1886
1887/**

Callers 2

ReverseTrainDirectionFunction · 0.85
TrainCheckIfLineEndsFunction · 0.85

Calls 3

IsCrossingBarredFunction · 0.85
SetCrossingReservationFunction · 0.85
UpdateLevelCrossingFunction · 0.85

Tested by

no test coverage detected