Skip to content

Commit

Permalink
Fix finance graph maximum finding algorithm. (OpenRCT2#22488)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmbernardi authored Aug 5, 2024
1 parent 0e1ba1c commit 9f0125b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/Finances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,10 @@ static Widget _windowFinancesResearchWidgets[] =
money64 maxVal = 0;
for (int32_t i = 0; i < kGraphNumPoints; i++)
{
auto val = series[i];
auto val = std::abs(series[i]);
if (val == kMoney64Undefined)
continue;
while (std::abs(val) > maxVal)
if (val > maxVal)
maxVal = val;
}
// This algorithm increments the leading digit of the max and sets all other digits to zero.
Expand Down

0 comments on commit 9f0125b

Please sign in to comment.