ACE3/addons/medical_treatment/functions/fnc_getStitchableWounds.sqf
mharis001 ec9e6c088b Medical - Only stitch wounds on not bleeding body parts (#7044)
* Only stitch wounds on not bleeding body parts
2019-09-28 21:48:19 +01:00

34 lines
730 B
Plaintext

#include "script_component.hpp"
/*
* Author: mharis001
* Returns a list of all the stitchable wounds that the given unit has.
* A stitchable wound is a bandaged wound on a body part that does not have any bleeding wounds.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Stitchable Wounds <ARRAY>
*
* Example:
* [player] call ace_medical_treatment_fnc_getStitchableWounds
*
* Public: No
*/
params ["_unit"];
private _bleedingBodyParts = GET_OPEN_WOUNDS(_unit) select {
_x params ["", "", "_amountOf", "_bleedingRate"];
_amountOf > 0 && {_bleedingRate > 0}
} apply {
_x select 1
};
GET_BANDAGED_WOUNDS(_unit) select {
_x params ["", "_bodyPartN"];
!(_bodyPartN in _bleedingBodyParts)
}