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

Function GetBridgeEnd

src/bridge_map.cpp:22–32  ·  view source on GitHub ↗

* Finds the end of a bridge in the specified direction starting at a middle tile * @param tile the bridge tile to find the bridge ramp for * @param dir the direction to search in */

Source from the content-addressed store, hash-verified

20 * @param dir the direction to search in
21 */
22static TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
23{
24 TileIndexDiff delta = TileOffsByDiagDir(dir);
25
26 dir = ReverseDiagDir(dir);
27 do {
28 tile += delta;
29 } while (!IsBridgeTile(tile) || GetTunnelBridgeDirection(tile) != dir);
30
31 return tile;
32}
33
34
35/**

Callers 3

GetNorthernBridgeEndFunction · 0.85
GetSouthernBridgeEndFunction · 0.85
GetOtherBridgeEndFunction · 0.85

Calls 4

TileOffsByDiagDirFunction · 0.85
ReverseDiagDirFunction · 0.85
IsBridgeTileFunction · 0.85
GetTunnelBridgeDirectionFunction · 0.85

Tested by

no test coverage detected