mirror of https://github.com/OpenRCT2/OpenRCT2.git
Play footpath placement sound even if footpath window is absent
This commit is contained in:
parent
6edcd6d7a0
commit
2d52f5b982
|
@ -1036,6 +1036,11 @@ private:
|
||||||
footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags);
|
footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags);
|
||||||
|
|
||||||
footpathPlaceAction.SetCallback([footpathLoc](const GameAction* ga, const GameActions::Result* result) {
|
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<FootpathWindow*>(WindowFindByClass(WindowClass::Footpath));
|
auto* self = static_cast<FootpathWindow*>(WindowFindByClass(WindowClass::Footpath));
|
||||||
if (self == nullptr)
|
if (self == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -1044,8 +1049,6 @@ private:
|
||||||
|
|
||||||
if (result->Error == GameActions::Status::Ok)
|
if (result->Error == GameActions::Status::Ok)
|
||||||
{
|
{
|
||||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position);
|
|
||||||
|
|
||||||
if (gFootpathConstructSlope == 0)
|
if (gFootpathConstructSlope == 0)
|
||||||
{
|
{
|
||||||
self->_footpathConstructValidDirections = INVALID_DIRECTION;
|
self->_footpathConstructValidDirections = INVALID_DIRECTION;
|
||||||
|
|
Loading…
Reference in New Issue