Fix #15009: Landscaping tools do not display estimates when paused (#25866)

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2026-01-27 22:09:33 +01:00
1 parent 545d269295
commit 7aaa124cef
4 files changed
+25 -12

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
- Improved: [#25858] macOS now supports the onboarding menu.
- Change: [#25018] Add upkeep cost to booster pieces.
- Fix: [#4643, #25167] Many metal supports draw with a filled in top when they didn't in vanilla, causing some slight misalignment and glitching.
- Fix: [#15009] Landscaping tools do not display estimates when the game is paused (original bug).
- Fix: [#25221] When trying to cancel game file discovery, the prompt reappears.
- Fix: [#25739] Game freezes when a tab in the New Ride window contains more than 384 items.
- Fix: [#25745] Crash when a player connection is aborted early.
+1
View File
@@ -288,6 +288,7 @@ namespace OpenRCT2::Ui::Windows
return;
auto action = GetClearAction();
action.SetFlags({ GameActions::CommandFlag::allowDuringPaused });
auto result = GameActions::Query(&action, getGameState());
auto cost = (result.error == GameActions::Status::ok ? result.cost : kMoney64Undefined);
if (_clearSceneryCost != cost)
+19 -12
View File
@@ -335,6 +335,21 @@ namespace OpenRCT2::Ui::Windows
}
private:
static money64 executeGameAction(GameState_t& gameState, GameActions::GameAction* action, SelectionMode mode)
{
GameActions::Result res;
if (mode == SelectionMode::apply)
{
res = GameActions::Execute(action, gameState);
}
else
{
action->SetFlags({ CommandFlag::allowDuringPaused });
res = GameActions::Query(action, gameState);
}
return res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
}
/**
*
* rct2: 0x006644DD
@@ -354,18 +369,14 @@ namespace OpenRCT2::Ui::Windows
{ centreX, centreY },
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
gMapSelectType, false);
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState)
: GameActions::Query(&landSmoothAction, gameState);
return res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
return executeGameAction(gameState, &landSmoothAction, mode);
}
auto landRaiseAction = GameActions::LandRaiseAction(
{ centreX, centreY },
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType);
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landRaiseAction, gameState)
: GameActions::Query(&landRaiseAction, gameState);
return res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
return executeGameAction(gameState, &landRaiseAction, mode);
}
/**
@@ -387,18 +398,14 @@ namespace OpenRCT2::Ui::Windows
{ centreX, centreY },
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
gMapSelectType, true);
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landSmoothAction, gameState)
: GameActions::Query(&landSmoothAction, gameState);
return res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
return executeGameAction(gameState, &landSmoothAction, mode);
}
auto landLowerAction = GameActions::LandLowerAction(
{ centreX, centreY },
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType);
auto res = (mode == SelectionMode::apply) ? GameActions::Execute(&landLowerAction, gameState)
: GameActions::Query(&landLowerAction, gameState);
return res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
return executeGameAction(gameState, &landLowerAction, mode);
}
/**
+4
View File
@@ -304,8 +304,10 @@ namespace OpenRCT2::Ui::Windows
auto waterLowerAction = GameActions::WaterLowerAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
waterLowerAction.SetFlags({ GameActions::CommandFlag::allowDuringPaused });
auto waterRaiseAction = GameActions::WaterRaiseAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
waterRaiseAction.SetFlags({ GameActions::CommandFlag::allowDuringPaused });
auto res = GameActions::Query(&waterLowerAction, gameState);
money64 lowerCost = res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;
@@ -394,8 +396,10 @@ namespace OpenRCT2::Ui::Windows
auto waterLowerAction = GameActions::WaterLowerAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
waterLowerAction.SetFlags({ GameActions::CommandFlag::allowDuringPaused });
auto waterRaiseAction = GameActions::WaterRaiseAction(
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y });
waterRaiseAction.SetFlags({ GameActions::CommandFlag::allowDuringPaused });
auto res = GameActions::Query(&waterLowerAction, gameState);
money64 lowerCost = res.error == GameActions::Status::ok ? res.cost : kMoney64Undefined;