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

Function IsRailStationPlatformOccupied

src/train_cmd.cpp:3614–3626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3612}
3613
3614static bool IsRailStationPlatformOccupied(TileIndex tile)
3615{
3616 TileIndexDiff delta = TileOffsByAxis(GetRailStationAxis(tile));
3617
3618 for (TileIndex t = tile; IsCompatibleTrainStationTile(t, tile); t -= delta) {
3619 if (HasVehicleOnTile(t, IsTrain)) return true;
3620 }
3621 for (TileIndex t = tile + delta; IsCompatibleTrainStationTile(t, tile); t += delta) {
3622 if (HasVehicleOnTile(t, IsTrain)) return true;
3623 }
3624
3625 return false;
3626}
3627
3628/**
3629 * Deletes/Clears the last wagon of a crashed train. It takes the engine of the

Callers 1

DeleteLastWagonFunction · 0.85

Calls 4

TileOffsByAxisFunction · 0.85
GetRailStationAxisFunction · 0.85
HasVehicleOnTileFunction · 0.85

Tested by

no test coverage detected