mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
mute unconsious units
This commit is contained in:
parent
28a8fbc4fe
commit
8976b6983d
@ -26,7 +26,7 @@ if !(_set) exitwith {
|
|||||||
_unit setvariable ["ACE_isUnconscious", false, true];
|
_unit setvariable ["ACE_isUnconscious", false, true];
|
||||||
};
|
};
|
||||||
|
|
||||||
if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{};
|
if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{};
|
||||||
|
|
||||||
if (!local _unit) exitwith {
|
if (!local _unit) exitwith {
|
||||||
[[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
[[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||||
@ -86,4 +86,7 @@ _startingTime = time;
|
|||||||
|
|
||||||
[DFUNC(unconsciousPFH), 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler;
|
[DFUNC(unconsciousPFH), 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
|
// unconscious can't talk
|
||||||
|
[_unit, "isUnconscious"] call EFUNC(common,muteUnit);
|
||||||
|
|
||||||
["medical_onUnconscious", [_unit, true]] call EFUNC(common,globalEvent);
|
["medical_onUnconscious", [_unit, true]] call EFUNC(common,globalEvent);
|
||||||
|
@ -31,6 +31,8 @@ if (!alive _unit) exitwith {
|
|||||||
[_unit, false] call EFUNC(common,disableAI);
|
[_unit, false] call EFUNC(common,disableAI);
|
||||||
//_unit setUnitPos _originalPos;
|
//_unit setUnitPos _originalPos;
|
||||||
_unit setUnconscious false;
|
_unit setUnconscious false;
|
||||||
|
|
||||||
|
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
|
||||||
["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent);
|
["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent);
|
||||||
|
|
||||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||||
@ -71,6 +73,8 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith {
|
|||||||
|
|
||||||
_unit setUnconscious false;
|
_unit setUnconscious false;
|
||||||
|
|
||||||
|
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
|
||||||
|
|
||||||
// ensure this statement runs only once
|
// ensure this statement runs only once
|
||||||
_args set [5, true];
|
_args set [5, true];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user