-
Notifications
You must be signed in to change notification settings - Fork 737
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
Fixes damage redirection issues #6231
Fixes damage redirection issues #6231
Conversation
Units accumulate damage in the local variables "ACE_Medical_Engine_$HitXXXX", but these are never reset. The way these vars are used is as a single-damage-event tracker, and the end result of not resetting their value when they're done being used is that a specific $HitXXXX can accumulate enough damage to cause the "select wound with highest damage" code to always select _it_ for the next wound event, even if it wasn't the primary target of the last wound event. I.E. I get shot in the right leg badly. If I then get winged in the left arm, that wound will end up on my right leg, because when the code runs, it finds QGVAR($HitRightLeg) > QGVAR($HitLeftArm), and so it applies the wound to the right leg.
This is a terrible idea. |
After looking closely at the handle damage code, I'm interpreting it the same way as @derbismarck and this seems to be a correct fix to me. It's just resetting the cached value that's used to determine where a wound should be applied between injuries. Entirely possible the code doesn't work like we're reading it though (assuming handler first fires for the normal hitpoint, then fires afterwards for the "ace_hdbracket" hitpoint which triggers the logic to apply a wound to whichever normal hitpoint took the most damage). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merging into the restructure branch. |
Bad news is that I can still reproduce this issue on latest restructure branch where this was merged 😢 |
I tested it some time ago in rewrite and it was working fine. Maybe variables have been moved? |
Yeah that's a possibility, I can't see any reason it shouldn't be working |
Nevermind, I just forgot to pull before testing 😆 It's been a while... |
Units accumulate damage in the local variables "ACE_Medical_Engine_$HitXXXX", but these are never reset. The way these vars are used is as a single-damage-event tracker, and the end result of not resetting their value when they're done being used is that a specific $HitXXXX can accumulate enough damage to cause the "select wound with highest damage" code to always select _it_ for the next wound event, even if it wasn't the primary target of the last wound event. I.E. I get shot in the right leg badly. If I then get winged in the left arm, that wound will end up on my right leg, because when the code runs, it finds QGVAR($HitRightLeg) > QGVAR($HitLeftArm), and so it applies the wound to the right leg.
Units accumulate damage in the local variables
"ACE_Medical_Engine_$HitXXXX", but these are never reset. The way these
vars are used is as a single-damage-event tracker, and the end result of
not resetting their value when they're done being used is that a
specific $HitXXXX can accumulate enough damage to cause the "select
wound with highest damage" code to always select it for the next wound
event, even if it wasn't the primary target of the last wound event.
I.E. I get shot in the right leg badly. If I then get winged in the left
arm, that wound will end up on my right leg, because when the code runs,
it finds QGVAR($HitRightLeg) > QGVAR($HitLeftArm), and so it applies the
wound to the right leg.
When merged this pull request will: