Merge pull request #872 from acemod/muteuncon

mute unconsious units
This commit is contained in:
commy2 2015-04-26 17:40:51 +02:00
commit 6aea424f6d
2 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,7 @@ if !(_set) exitwith {
_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 {
[[_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;
// unconscious can't talk
[_unit, "isUnconscious"] call EFUNC(common,muteUnit);
["medical_onUnconscious", [_unit, true]] call EFUNC(common,globalEvent);

View File

@ -31,6 +31,8 @@ if (!alive _unit) exitwith {
[_unit, false] call EFUNC(common,disableAI);
//_unit setUnitPos _originalPos;
_unit setUnconscious false;
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent);
[(_this select 1)] call cba_fnc_removePerFrameHandler;
@ -71,6 +73,8 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith {
_unit setUnconscious false;
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
// ensure this statement runs only once
_args set [5, true];
};