From 2d52f5b98295eb467940e5cafd08cfea73416670 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 27 Feb 2024 22:26:43 +0100 Subject: [PATCH] Play footpath placement sound even if footpath window is absent --- src/openrct2-ui/windows/Footpath.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index d7d1f412eb..d24ffce194 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1036,6 +1036,11 @@ private: footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); footpathPlaceAction.SetCallback([footpathLoc](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + } + auto* self = static_cast(WindowFindByClass(WindowClass::Footpath)); if (self == nullptr) { @@ -1044,8 +1049,6 @@ private: if (result->Error == GameActions::Status::Ok) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - if (gFootpathConstructSlope == 0) { self->_footpathConstructValidDirections = INVALID_DIRECTION;