Skip to content
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

Merged

Conversation

derbismarck
Copy link
Contributor

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:

  • Fix the above-described issue

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.
@commy2
Copy link
Contributor

commy2 commented Apr 9, 2018

This is a terrible idea.

@kymckay kymckay added kind/bug-fix Release Notes: **FIXED:** area/focus-feature labels Apr 15, 2018
@kymckay
Copy link
Member

kymckay commented Apr 15, 2018

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).

@kymckay kymckay added this to the Medical Rewrite milestone Apr 15, 2018
@kymckay
Copy link
Member

kymckay commented Apr 20, 2018

In image of the issue in action:

2018-04-20_13-47-59

All of the shots listed in the bottom left were put where my cursor is, clearly the torso

Copy link
Contributor

@thojkooi thojkooi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thojkooi thojkooi changed the base branch from medical-rewrite to medical-rewrite-restructure July 16, 2018 21:48
@thojkooi
Copy link
Contributor

Merging into the restructure branch.

@thojkooi thojkooi merged commit e566cbf into acemod:medical-rewrite-restructure Jul 16, 2018
@kymckay
Copy link
Member

kymckay commented Jul 17, 2018

Bad news is that I can still reproduce this issue on latest restructure branch where this was merged 😢

@TheMagnetar
Copy link
Member

I tested it some time ago in rewrite and it was working fine. Maybe variables have been moved?

@kymckay
Copy link
Member

kymckay commented Jul 17, 2018

Yeah that's a possibility, I can't see any reason it shouldn't be working

@kymckay
Copy link
Member

kymckay commented Jul 17, 2018

Nevermind, I just forgot to pull before testing 😆 It's been a while...

BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
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.
@PabstMirror PabstMirror modified the milestones: Medical Rewrite, 3.13.0, 3.13.0-temp3 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/focus-feature kind/bug-fix Release Notes: **FIXED:**
Projects
Development

Successfully merging this pull request may close these issues.

6 participants