mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Replaced injuredCollection array for separate PFH for each unit.
This commit is contained in:
parent
3be442c31a
commit
633037c1b4
@ -1,28 +1,6 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
[{
|
||||
{
|
||||
if (!alive _x || !local _x) then {
|
||||
GVAR(injuredUnitCollection) set [ _forEachIndex, ObjNull];
|
||||
} else {
|
||||
[_x] call FUNC(handleUnitVitals);
|
||||
|
||||
private "_pain";
|
||||
_pain = _X getvariable [QGVAR(pain), 0];
|
||||
if (_pain > 45) then {
|
||||
if (random(1) > 0.6) then {
|
||||
// [_X] call FUNC(setUnconsciousState);
|
||||
};
|
||||
//[_X] call FUNC(playInjuredSound);
|
||||
};
|
||||
};
|
||||
}foreach GVAR(injuredUnitCollection);
|
||||
GVAR(injuredUnitCollection) = GVAR(injuredUnitCollection) - [ObjNull];
|
||||
}, 1, [] ] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
|
||||
if (!hasInterface) exitwith{};
|
||||
//45 cutRsc [QGVAR(ScreenEffectsBlack),"PLAIN"];
|
||||
|
||||
|
@ -21,9 +21,22 @@ if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{
|
||||
};
|
||||
|
||||
if ([_unit] call FUNC(hasMedicalEnabled)) then {
|
||||
if (isnil QGVAR(injuredUnitCollection)) then {
|
||||
GVAR(injuredUnitCollection) = [];
|
||||
};
|
||||
if (_unit in GVAR(injuredUnitCollection)) exitwith {};
|
||||
GVAR(injuredUnitCollection) pushback _unit;
|
||||
[{
|
||||
private "_unit";
|
||||
_unit = (_this select 0) select 0;
|
||||
if (!alive _unit || !local _unit) then {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
[_unit] call FUNC(handleUnitVitals);
|
||||
|
||||
private "_pain";
|
||||
_pain = _unit getvariable [QGVAR(pain), 0];
|
||||
if (_pain > 45) then {
|
||||
if (random(1) > 0.6) then {
|
||||
// [_unit] call FUNC(setUnconsciousState);
|
||||
};
|
||||
//[_unit] call FUNC(playInjuredSound);
|
||||
};
|
||||
};
|
||||
}, 1, [_unit]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user