From 9e03ec4caa42d36a0726ca23013d03f6eb99cafb Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Sun, 19 Oct 2025 22:35:57 +0200 Subject: [PATCH] Fix stack corruption when footpath dragging --- src/openrct2-ui/windows/Footpath.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index eb4ed119f7..ff49562a97 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1300,15 +1300,12 @@ namespace OpenRCT2::Ui::Windows { auto footpathPlaceAction = GameActions::FootpathPlaceAction( tile.position, tile.slope, selectedType, gFootpathSelection.Railings, kInvalidDirection, constructFlags); - footpathPlaceAction.SetCallback( - [&anySuccess, &cost](const GameActions::GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - anySuccess = true; - cost += result->Cost; - } - }); - GameActions::Execute(&footpathPlaceAction, getGameState()); + auto result = GameActions::Execute(&footpathPlaceAction, getGameState()); + if (result.Error == GameActions::Status::Ok) + { + anySuccess = true; + cost += result.Cost; + } lastLocation = tile.position; }