Medical - Fix Uncon PFEH argument changes

This commit is contained in:
PabstMirror 2015-05-01 22:42:43 -05:00
parent 4dce2b8841
commit 436e50411a
2 changed files with 13 additions and 6 deletions

View File

@ -23,10 +23,10 @@ if (_local) then {
[_unit, true] call FUNC(addToInjuredCollection);
};
if ((_unit getvariable ["ACE_isUnconscious",false]) && {count (_unit getvariable [QGVAR(unconsciousArguments), []]) >= 7}) then {
if ((_unit getvariable ["ACE_isUnconscious",false]) && {count (_unit getvariable [QGVAR(unconsciousArguments), []]) >= 6}) then {
private "_arguments";
_arguments = (_unit getvariable [QGVAR(unconsciousArguments), []]);
_arguments set [ 3, time];
_arguments set [2, time];
[DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler;

View File

@ -3,7 +3,14 @@
* PFH logic for unconscious state
*
* Arguments:
* 0: The unit that will be put in an unconscious state <OBJECT>
* 0: PFEH - Args
* 0: The unit that will be put in an unconscious state <OBJECT>
* 1: unitPos (stance) <STRING>
* 2: Starting Time <NUMBER>
* 3: Minimum Waiting Time <NUMBER>
* 4: Has Moved Out <BOOL>
* 5: Parachute Check <BOOL>
* 1: PFEH ID <NUMBER>
*
* ReturnValue:
* nil
@ -102,19 +109,19 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith {
[_unit, "isUnconscious"] call EFUNC(common,unmuteUnit);
// ensure this statement runs only once
_args set [5, true];
_args set [4, true];
};
};
if (_parachuteCheck) then {
if !(vehicle _unit isKindOf "ParachuteBase") then {
[_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation);
_args set [6, false];
_args set [5, false];
};
};
if (!local _unit) exitwith {
_args set [ 4, _minWaitingTime - (time - _startingTime)];
_args set [3, _minWaitingTime - (time - _startingTime)];
_unit setvariable [QGVAR(unconsciousArguments), _args, true];
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};