mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Fix stack corruption when footpath dragging
This commit is contained in:
committed by
GitHub
parent
d95a7c4fc7
commit
9e03ec4caa
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user