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; }