2015-07-03 20:16:18 +00:00
|
|
|
/*
|
|
|
|
* 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-07-03 20:16:18 +00:00
|
|
|
|
2015-11-30 16:14:05 +00:00
|
|
|
if (GVAR(level) <= 1) exitWith {
|
2015-07-03 20:16:18 +00:00
|
|
|
([_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;
|
2015-07-03 20:16:18 +00:00
|
|
|
|
|
|
|
(_totalBloodLoss == 0);
|