mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2026-05-06 07:56:46 -04:00
The path and wall drag tools query each tile individually for affordability so all queries pass when the player can afford any single tile. But if the total exceeds available funds, execution fails midway with per tile error windows. To fix it this adds a total cost check against available funds after the query phase, showing a single combined error with the full cost before execution actually starts
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
- Fix: [#26421] Wrong scenery tab highlighted when more than 64 scenery groups are selected.
|
||||
- Fix: [#26425] Benches don’t reduce watching spots from 4 to 2 while other path additions do (should be reversed).
|
||||
- Fix: [#26432] Guests choose to head for rides they have already ridden if they don’t have a map.
|
||||
- Fix: [#26492] Drag tool shows per-tile error instead of total cost when running out of money midway through placement.
|
||||
|
||||
0.5.0 (2026-04-12)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -1319,6 +1319,18 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(getGameState().park.flags & PARK_FLAGS_NO_MONEY) && totalCost > getGameState().park.cash)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::error, lastLocation);
|
||||
_footpathErrorOccured = true;
|
||||
|
||||
auto* windowMgr = GetWindowManager();
|
||||
Formatter ft;
|
||||
ft.Add<money64>(totalCost);
|
||||
windowMgr->ShowError(STR_CANT_BUILD_FOOTPATH_HERE, STR_NOT_ENOUGH_CASH_REQUIRES, ft);
|
||||
return;
|
||||
}
|
||||
|
||||
// All queries passed, now execute
|
||||
bool anySuccess = false;
|
||||
money64 cost = 0;
|
||||
|
||||
@@ -3291,6 +3291,20 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(getGameState().park.flags & PARK_FLAGS_NO_MONEY) && totalCost > getGameState().park.cash)
|
||||
{
|
||||
Audio::Play3D(Audio::SoundId::error, lastLocation);
|
||||
|
||||
auto* windowMgr = GetWindowManager();
|
||||
Formatter ft;
|
||||
ft.Add<money64>(totalCost);
|
||||
windowMgr->ShowError(STR_CANT_BUILD_THIS_HERE, STR_NOT_ENOUGH_CASH_REQUIRES, ft);
|
||||
|
||||
_provisionalTiles.clear();
|
||||
_inDragMode = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// All queries passed, now execute
|
||||
bool anySuccessful = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user