From 95fa0e34e02c090755d991c338949077cee6fcea Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 19 Jul 2021 14:57:32 +0200 Subject: [PATCH] Integrate loc_68BAE6 --- src/openrct2/world/Map.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 618ec14d36..7132d49164 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1361,7 +1361,19 @@ std::unique_ptr MapCanConstructWithClearAt( res->GroundFlags |= ELEMENT_IS_UNDERWATER; if (water_height < pos.clearanceZ) { - goto loc_68BAE6; + if (clearFunc != nullptr) + { + if (!clearFunc(&tileElement, pos, flags, &res->Cost)) + { + goto loc_68B9B7; + } + } + if (tileElement != nullptr) + { + res->Error = GameActions::Status::NoClearance; + res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; + } + return res; } } loc_68B9B7: @@ -1469,21 +1481,6 @@ std::unique_ptr MapCanConstructWithClearAt( res->Error = GameActions::Status::NoClearance; } return res; - - loc_68BAE6: - if (clearFunc != nullptr) - { - if (!clearFunc(&tileElement, pos, flags, &res->Cost)) - { - goto loc_68B9B7; - } - } - if (tileElement != nullptr) - { - res->Error = GameActions::Status::NoClearance; - res->ErrorMessage = STR_CANNOT_BUILD_PARTLY_ABOVE_AND_PARTLY_BELOW_WATER; - } - return res; } } } while (!(tileElement++)->IsLastForTile());