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

Function PlaceRail_Bridge

src/rail_gui.cpp:294–303  ·  view source on GitHub ↗

* Start placing a rail bridge. * @param tile Position of the first tile of the bridge. * @param w Rail toolbar window. */

Source from the content-addressed store, hash-verified

292 * @param w Rail toolbar window.
293 */
294static void PlaceRail_Bridge(TileIndex tile, Window *w)
295{
296 if (IsBridgeTile(tile)) {
297 TileIndex other_tile = GetOtherTunnelBridgeEnd(tile);
298 Point pt = {0, 0};
299 w->OnPlaceMouseUp(VPM_X_OR_Y, DDSP_BUILD_BRIDGE, pt, other_tile, tile);
300 } else {
301 VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_BUILD_BRIDGE);
302 }
303}
304
305/** Command callback for building a tunnel */
306void CcBuildRailTunnel(Commands, const CommandCost &result, TileIndex tile)

Callers 1

OnPlaceObjectMethod · 0.85

Calls 4

IsBridgeTileFunction · 0.85
GetOtherTunnelBridgeEndFunction · 0.85
VpStartPlaceSizingFunction · 0.85
OnPlaceMouseUpMethod · 0.45

Tested by

no test coverage detected