ACE3/addons/medical/functions/fnc_isInStableCondition.sqf

31 lines
604 B
Plaintext
Raw Normal View History

/*
* Author: Glowbal
* Check if a unit is in a stable condition
*
* Arguments:
* 0: The patient <OBJECT>
*
* Return Value:
* Is in stable condition <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
2015-08-22 14:25:10 +00:00
private ["_openWounds", "_openWounds"];
params ["_unit"];
2015-11-30 16:14:05 +00:00
if (GVAR(level) <= 1) exitWith {
([_unit] call FUNC(getBloodloss)) == 0;
};
_totalBloodLoss = 0;
_openWounds = _unit getvariable [QGVAR(openWounds), []];
{
// total bleeding ratio * percentage of injury left
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
2015-11-30 16:23:48 +00:00
} forEach _openWounds;
(_totalBloodLoss == 0);