From 3278051913027960ab9a3086fd7b1743302c91b7 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 22 Feb 2017 02:47:14 +0000 Subject: [PATCH] Fix crash when removing secondary road type from tunnel. --- src/road_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 48189374fb..962486f823 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -250,7 +250,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec other_end_pieces |= other_end_existing; } pieces_count += middle_len * 2; - if ((GetCustomBridgeHeadRoadBits(tile, other_rt) & entrance_piece) == ROAD_NONE) { + if (custom_bridge_head && ((GetCustomBridgeHeadRoadBits(tile, other_rt) & entrance_piece) == ROAD_NONE)) { /* can't leave no entrance pieces for any road type */ return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); }