* 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 */
| 20 | * @param dir the direction to search in |
| 21 | */ |
| 22 | static 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 | /** |
no test coverage detected