ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

Medical Engine - Remove ACE_HDBracket hitpoint

Open LinkIsGrim opened this issue 2 years ago • 8 comments

When merged this pull request will:

  • Arma 2.16 adds "context" param to HD which lets us know if we're at the last iteration of the event: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
  • Some stuff had to be moved around in the function but it'll work the same.
  • While this means that medical will still work even with broken inheritance now, arm/leg hitpoints could still be missing due to the same issue. I've added a check for presence of those hitpoints, but it's slower than just checking HDBracket by about 25% (0.05ms for 1k iterations vs. 0.04ms). This is only relevant at unit init, and time is saved during damage events (which is where performance suffers most) by reducing a hitpoint.

I'm looking into whether it's possible to simplify more of the function via other events or the directHit param.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

LinkIsGrim avatar Jan 14 '24 16:01 LinkIsGrim

Looks like this has been pushed to 2.18 https://community.bistudio.com/wiki?title=Arma_3:_Event_Handlers#HandleDamage

johnb432 avatar Feb 08 '24 12:02 johnb432

Check if this made it into 2.16 or not. SPOTREP says it did.

LinkIsGrim avatar Mar 26 '24 13:03 LinkIsGrim

Made it into 2.16. Just need to fix merge conflicts

LinkIsGrim avatar Mar 26 '24 14:03 LinkIsGrim

I was not expecting this at all and thought we had more time for 2.16.

johnb432 avatar Mar 26 '24 14:03 johnb432

Eh, it'll work.

LinkIsGrim avatar Mar 26 '24 16:03 LinkIsGrim

Don't we need to include this in 3.17.0 for 2.16 compatibility?

jonpas avatar Mar 28 '24 13:03 jonpas

Nothing breaks AFAIK

LinkIsGrim avatar Mar 28 '24 13:03 LinkIsGrim

Doesn't seem like anything breaks, at least for "normal" damage (being shot, being driven over and falling). I didn't test very much, I feel more in depth testing could be better done by an RC.

johnb432 avatar Apr 01 '24 10:04 johnb432

I played around with this for about an hour or so, tried a bunch of things to cause different types of injury, no obvious issues or errors.

Only change this PR needs to address now is this: https://github.com/acemod/ACE3/blob/565d64d50ed775dafbbefafe05457577e955712b/addons/medical/XEH_preStart.sqf#L5

Mike-MF avatar Jun 07 '24 13:06 Mike-MF

Green button go brrt (flood my inbox if something breaks)

LinkIsGrim avatar Jun 11 '24 14:06 LinkIsGrim