-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGFPE: Arithmetical error in vehicle::thrust #45473
Comments
Here is the reproduction (on the latest master 0.E-7748-g55fac0a69d). |
Also there is another special check for Line 3528 in 8d87f15
Seems like it's a long-lasting problem which happens there and here. Meantime I've found out strange behavior for dual-engine transport like electrobike: when the character is out of stamina it doesn't switch to electrical motor automatically and just stops. Only if you turn off muscle engine manually, then you can start moving again. Maybe it is related, vehicle doesn't switch to only-muscle engine and accel calculation doesn't take it into account, but it seems strange because in this case you just have to decelerate to 0 ad stop. I'm just guessing and this can be wrong assumption. |
Ok, that happens when character is too weak (because of exhaustion or any other kind of debuff) to beat bicycle alternator, so both electrical engine and muscle engine provide zero power and thus zero acceleration and finally when we set cruise speed less than current speed we get |
It fixes rare case when all engines produce zero power due to no fuel or exhausted character and target cruise speed is set less than current. fixes CleverRaven#45473
It fixes rare case when all engines produce zero power due to no fuel or exhausted character and target cruise speed is set less than current. fixes #45473
Describe the bug
I've got SIGFPE when applied handbrake for electrobike with empty batteries and exhausted character. (or push some random keys when running from the horde)
Steps To Reproduce
Reproduction steps are posted in the first comment.
Expected behavior
Handle integer division correctly.
Versions and configuration
Additional context
Backtrace:
Disasm:
This is exactly this line of code:
Cataclysm-DDA/src/vehicle_move.cpp
Line 466 in 8d87f15
I would suggest to add
&& accel != 0
into this conditionCataclysm-DDA/src/vehicle_move.cpp
Line 454 in 8d87f15
but I'm not very familiar with the code, just performed quick investigation of what has happened.
The text was updated successfully, but these errors were encountered: