Fixed unconscious. Now functions properly again after move from common to medical.

This commit is contained in:
Thomas Kooi 2015-01-25 16:40:47 +01:00
parent 3c60af5a14
commit b28fa367cb
5 changed files with 11 additions and 11 deletions

View File

@ -12,4 +12,4 @@
private ["_unit","_return"];
_unit = _this select 0;
(!([_unit] call FUNC(isUnconscious))) && alive _unit && !(_unit getvariable ["ACE_isDead",false]);
(!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false]));

View File

@ -26,7 +26,7 @@ GVAR(injuredUnitCollection) = [];
};
if (_pain > 45) then {
if (random(1) > 0.6) then {
[_X] call EFUNC(common,setUnconsciousState);
[_X] call FUNC(setUnconsciousState);
};
//[_X] call FUNC(playInjuredSound);
};

View File

@ -69,7 +69,7 @@ if ([_unit] call FUNC(hasMedicalEnabled)) then {
} else {
[_unit] call FUNC(addToInjuredCollection);
if ([_unit, _bodyPartn] call FUNC(determineIfUnconscious)) then {
[_unit] call EFUNC(common,setUnconsciousState);
[_unit] call FUNC(setUnconsciousState);
} else {
[_unit,_newDamage] call FUNC(handleReactionHit);
};

View File

@ -60,7 +60,7 @@ if (_bloodVolume < 30) exitwith {
if ([_unit] call EFUNC(common,isAwake)) then {
if (_bloodVolume < 60) then {
if (random(1) > 0.9) then {
[_unit] call EFUNC(common,setUnconsciousState);
[_unit] call FUNC(setUnconsciousState);
};
};
};
@ -97,13 +97,11 @@ if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) exitwit
_bloodPressureL = _bloodPressure select 0;
_bloodPressureH = _bloodPressure select 1;
if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then {
[_unit] call EFUNC(common,setUnconsciousState); // safety check to ensure unconsciousness for units if they are not dead already.
};
if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then {
if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then {
[_unit] call FUNC(setUnconsciousState); // safety check to ensure unconsciousness for units if they are not dead already.
};
if (_bloodPressureH > 260) then {
if (random(1) > 0.7) then {
[_unit] call FUNC(setCardiacArrest);

View File

@ -20,11 +20,12 @@ _unit setvariable [QGVAR(inCardiacArrest), true,true];
["Medical_onEnteredCardiacArrest", [_unit]] call ace_common_fnc_localEvent;
[_unit] call EFUNC(common,setUnconsciousState);
[_unit] call FUNC(setUnconsciousState);
_counter = 120 + round(random(600));
_timer = 0;
[{
private ["_args","_unit","_timer","_counter","_heartRate"];
_args = _this select 0;
_unit = _args select 0;
_timer = _args select 1;
@ -36,6 +37,7 @@ _timer = 0;
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if (_counter - _timer < 1) exitwith {
[_unit] call FUNC(setDead);
[(_this select 1)] call cba_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inCardiacArrest), nil,true];