mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
@@ -20,6 +20,7 @@
|
||||
- Fix: [#20417] Plugin/custom windows are missing the left border in the title bar.
|
||||
- Fix: [#20429] Error window tooltip not closing after 8 seconds.
|
||||
- Fix: [#20364] Adding too much money with cheats causes an overflow.
|
||||
- Fix: [#20365] Money cheat input does not support negative values.
|
||||
|
||||
0.4.5 (2023-05-08)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -414,14 +414,10 @@ money64 StringToMoney(const char* string_to_monetise)
|
||||
if (numNumbers == 0)
|
||||
return MONEY64_UNDEFINED;
|
||||
|
||||
int64_t sign = 1;
|
||||
if (hasMinus)
|
||||
if (hasMinus && processedString[0] != '-')
|
||||
{
|
||||
// If there is a minus sign, it has to be at position 0 in order to be valid.
|
||||
if (processedString[0] == '-')
|
||||
sign = -1;
|
||||
else
|
||||
return MONEY64_UNDEFINED;
|
||||
return MONEY64_UNDEFINED;
|
||||
}
|
||||
|
||||
// Due to the nature of strstr and strtok, decimals at the very beginning will be ignored, causing
|
||||
@@ -436,7 +432,7 @@ money64 StringToMoney(const char* string_to_monetise)
|
||||
auto number = std::stod(processedString, nullptr);
|
||||
number /= (currencyDesc->rate / 10.0);
|
||||
|
||||
return ToMoney64FromGBP(number) * sign;
|
||||
return ToMoney64FromGBP(number);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user