-
Notifications
You must be signed in to change notification settings - Fork 736
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
Fix healHitPointAfterAdvBandage - Issue #2498. #2646
Conversation
Thank you for your contribution! Could you please reformat your code to follow our Coding Guidelines? |
Thank you @DerekSauer This PR reintroduces the bug where injuries that does not cause bloodloss will prefent the heal hitpoints after bandaging working (the bruises bug). To fix this, use both the injury amount and the bloodloss. Example: ((_x select 4) * (_x select 3)) > 0 |
The code is now taking into account wounds that do not cause bleeding (bruises). Thanks for the heads up Glowbal, I would not have considered that. It should now also comply with ACE3's coding guidelines. Let me know if I missed any. |
Used the wrong method to retrieve the target's current wounds and was getting an empty array. This caused bandaging any wound even once to completely heal the target on the Arma side.
if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { | ||
_legsWounds = _legsWounds + 1; | ||
}; | ||
} foreach _currentWounds; |
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.
forEach
_x params ["", "", "_bodyPart", "_numOpenWounds", "_bloodLoss"]; | ||
|
||
// Head | ||
if (_bodyPart == 0 && {(_numOpenWounds * _bloodLoss) > 0}) then { |
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.
Create an early exit condition for (_numOpenWounds * _bloodLoss) > 0
that way it only has to be evaluated 1 time instead of 6 times in the worst case, as well as skipping 6 value checks and making the code look cleaner.
Using a switch/case conditional since it offers early termination if a matching condition is found before all conditions are checked. It also unnecessary to use a conditional to confirm whether a limb is wounded or not. Number of Wounds multiplied by Blood loss will return zero for a fully bandaged body part, not incrementing the wound counter; or it will return some other number which will increment the wound counter.
Thanks @DerekSauer 👍 Fix #2498 |
Fix healHitPointAfterAdvBandage - Issue #2498.
Issue: Adv. Medical Heal hitpoints doesn't work #2498.
With "ace_medical_healHitPointAfterAdvBandage" enabled fully bandaging wounded body parts were not healing those body parts in the Arma engine. ACE's interface would show body parts fully bandaged and undamaged but the player's uniform would remain bloody and the effected parts would remain non-functional (E.g.: Even though ACE thinks your legs are healed, Arma doesn't and you can't run. Your pants are also full of blood).
This fix checks to see if an ACE body part is fully bandaged and then heals the respective Arma body part while keeping in mind that Arma does not have separate body parts for left & right arms and legs.