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

Function SetRailStationPlatformReservation

src/pbs.cpp:57–70  ·  view source on GitHub ↗

* Set the reservation for a complete station platform. * @pre IsRailStationTile(start) * @param start starting tile of the platform * @param dir the direction in which to follow the platform * @param b the state the reservation should be set to */

Source from the content-addressed store, hash-verified

55 * @param b the state the reservation should be set to
56 */
57void SetRailStationPlatformReservation(TileIndex start, DiagDirection dir, bool b)
58{
59 TileIndex tile = start;
60 TileIndexDiff diff = TileOffsByDiagDir(dir);
61
62 assert(IsRailStationTile(start));
63 assert(GetRailStationAxis(start) == DiagDirToAxis(dir));
64
65 do {
66 SetRailStationReservation(tile, b);
67 MarkTileDirtyByTile(tile);
68 tile = TileAdd(tile, diff);
69 } while (IsCompatibleTrainStationTile(tile, start));
70}
71
72/**
73 * Try to reserve a specific track on a tile

Callers 6

ReverseTrainDirectionFunction · 0.85
ClearPathReservationFunction · 0.85
DeleteLastWagonFunction · 0.85
FreeTrainReservationFunction · 0.85
RestoreTrainReservationFunction · 0.85
CmdBuildRailStationFunction · 0.85

Calls 8

TileOffsByDiagDirFunction · 0.85
IsRailStationTileFunction · 0.85
GetRailStationAxisFunction · 0.85
DiagDirToAxisFunction · 0.85
MarkTileDirtyByTileFunction · 0.70
TileAddFunction · 0.70

Tested by

no test coverage detected