From e84689a7718eb6b4f17a8f5c0a61184867c62961 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 15 Apr 2015 11:46:01 -0500 Subject: [PATCH] #544 - Change ERROR warning to debug trace --- addons/captives/functions/fnc_setHandcuffed.sqf | 17 ++++++++--------- .../captives/functions/fnc_setSurrendered.sqf | 3 +-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index e992339186..5f134ab03b 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -29,11 +29,11 @@ if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith if (_state) then { _unit setVariable [QGVAR(isHandcuffed), true, true]; [_unit, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus); - + if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop [_unit, false] call FUNC(setSurrendered); }; - + //Set unit cargoIndex (will be -1 if dismounted) _unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true]; @@ -47,30 +47,29 @@ if (_state) then { if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); - + //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { - ERROR("Handcuff animation interrupted"); - // systemChat format ["debug %2: new %1", _newAnimation, time]; + TRACE_1("Handcuff animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; }]; _unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID]; - + }; }, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute); } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); - - //remove AnimChanged EH + + //remove AnimChanged EH _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - + if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 30f9105511..d774e7f6e0 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -51,8 +51,7 @@ if (_state) then { _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { - ERROR("Surrender animation interrupted"); - // systemChat format ["debug %2: new %1", _newAnimation, time]; + TRACE_1("Surrender animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); }; }];