diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 36e535df48..bbed23f703 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1889,14 +1889,14 @@ static void window_top_toolbar_scenery_tool_down(int16_t x, int16_t y, rct_windo CoordsXYZD loc = { gridX, gridY, gSceneryPlaceZ, (parameter_1 & 0xFF00) >> 8 }; auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, largeSceneryType, primaryColour, secondaryColour); - sceneryPlaceAction.SetCallback([](const GameAction* ga, const GameActionResult* result) { + sceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) { if (result->Error == GA_ERROR::OK) { audio_play_sound_at_location(SOUND_PLACE_ITEM, result->Position.x, result->Position.y, result->Position.z); } else { - audio_play_sound_at_location(SOUND_ERROR, result->Position.x, result->Position.y, result->Position.z); + audio_play_sound_at_location(SOUND_ERROR, loc.x, loc.y, gSceneryPlaceZ); } }); auto res = GameActions::Execute(&sceneryPlaceAction); diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.hpp b/src/openrct2/actions/LargeSceneryPlaceAction.hpp index f54934d67e..ff205c7128 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.hpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.hpp @@ -129,15 +129,14 @@ public: GA_ERROR::NO_CLEARANCE, STR_CANT_POSITION_THIS_HERE, gGameCommandErrorText, gCommonFormatArgs); } - if ((gMapGroundFlags & ELEMENT_IS_UNDERWATER) || (gMapGroundFlags & ELEMENT_IS_UNDERGROUND)) - { - log_error("Can't place object underwater / underground."); - return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE); - } int32_t tempSceneryGroundFlags = gMapGroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (!gCheatsDisableClearanceChecks) { + if ((gMapGroundFlags & ELEMENT_IS_UNDERWATER) || (gMapGroundFlags & ELEMENT_IS_UNDERGROUND)) + { + return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); + } if (gSceneryGroundFlags && !(gSceneryGroundFlags & tempSceneryGroundFlags)) { return MakeResult( @@ -154,8 +153,7 @@ public: if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_owned(curTile.x, curTile.y, zLow * 8) && !gCheatsSandboxMode) { - log_error("Location not owned."); - return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE); + return MakeResult(GA_ERROR::DISALLOWED, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } }