Rerun set func when respawn into captive unit

This commit is contained in:
PabstMirror 2015-03-26 14:21:26 -05:00
parent d4d0a0a6de
commit 14cbceef97

View File

@ -20,5 +20,20 @@ PARAMS_2(_unit,_dead);
if (!local _unit) exitWith {};
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
//With respawn="group", we could be respawning into a unit that is handcuffed/captive
//If they are, reset and rerun the SET function
//if not, make sure to explicity disable the setCaptivityStatus, because captiveNum does not work correctly on respawn
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
_unit setVariable [QGVAR(isHandcuffed), false];
[_unit, true] call FUNC(setHandcuffed);
} else {
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
[_unit, true] call FUNC(setSurrendered);
} else {
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
};