-
Notifications
You must be signed in to change notification settings - Fork 184
Deliver a certain amount of cargo stepper has odd behaviour #3028
Description
Version information:
- Platform: Windows 10
- Version: 25.02
Describe the bug
When setting a "Deliver a certain amount of cargo" objective in the scenario editor, the number selector thing has odd behaviour. Original Locomotion (Steam) does not have these issues. It feels like it may be integer overflow/underflow errors that only happens depending on the step size (which changes based on how long you hold the button).
Specifics:
- If you click and hold the subtract button for long enough, instead of having a minimum value of 100 tons, it can underflow to 35 million and something tons.
- Clicking the + or - when it is above a certain value causes it to suddenly reduce by a lot (overflow?): 77,777,700 tons is treated as 5,688,100 tons. 35,123,000 tons is treated as 2,355,000 tons.
To Reproduce
- Go to scenario editor
- Click bottom-right button twice
- Change the drop-down to the bottom option
- Play with the + and - buttons (and/or scrollwheel)
OR: You could also attempt to modify a scenario created in the original game by loading it in the scenario editor and attempting to edit its objective, if it had a high cargo deliver objective. For example, this one that I created by holding the increase button for several minutes in the Steam version of the game: 77 Million tons of Chemicals please.zip
Speculation
Does changing this to a 32 bit int fix this issue?
| uint16_t cargoFactor = (Scenario::getObjective().deliveredCargoAmount - stepSize) / stepSize; |