From f538179878370b3bec8bf1575dc30c1377461ebc Mon Sep 17 00:00:00 2001 From: peter1138 Date: Mon, 11 Mar 2019 10:37:47 +0000 Subject: Feature: Multi-tile docks and docking points. --- src/rail_cmd.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/rail_cmd.cpp') diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index ab87fc40f..df862d4f2 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -570,6 +570,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u default: { /* Will there be flat water on the lower halftile? */ bool water_ground = IsTileType(tile, MP_WATER) && IsSlopeWithOneCornerRaised(tileh); + bool docking = IsPossibleDockingTile(tile) && IsDockingTile(tile); CommandCost ret = CheckRailSlope(tileh, trackbit, TRACK_BIT_NONE, tile); if (ret.Failed()) return ret; @@ -586,7 +587,10 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u if (flags & DC_EXEC) { MakeRailNormal(tile, _current_company, trackbit, railtype); - if (water_ground) SetRailGroundType(tile, RAIL_GROUND_WATER); + if (water_ground) { + SetRailGroundType(tile, RAIL_GROUND_WATER); + SetDockingTile(tile, docking); + } Company::Get(_current_company)->infrastructure.rail[railtype]++; DirtyCompanyInfrastructureWindows(_current_company); } @@ -708,7 +712,9 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, Slope tileh = GetTileSlope(tile); /* If there is flat water on the lower halftile, convert the tile to shore so the water remains */ if (GetRailGroundType(tile) == RAIL_GROUND_WATER && IsSlopeWithOneCornerRaised(tileh)) { + bool docking = IsDockingTile(tile); MakeShore(tile); + SetDockingTile(tile, docking); } else { DoClearSquare(tile); } -- cgit v1.2.3-54-g00ecf