1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Fix finance graph maximum finding algorithm. (#22488)

This commit is contained in:
mrmbernardi
2024-08-06 02:29:21 +10:00
committed by GitHub
parent 0e1ba1cacd
commit 9f0125b509

View File

@@ -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.