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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user