This commit is contained in:
commy2 2015-03-29 21:23:20 +02:00
commit d2e6d5887a
7 changed files with 58 additions and 9 deletions

View File

@ -41,3 +41,11 @@ class Extended_InitPost_EventHandlers {
};
};
};
//make sure captiveNum is reset on respawn
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE(_this call FUNC(handleRespawn));
};
};
};

View File

@ -21,6 +21,7 @@ PREP(handleGetOut);
PREP(handleKilled);
PREP(handleOnUnconscious);
PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);

View File

@ -18,7 +18,7 @@
PARAMS_1(_oldUnit);
if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then {
_oldUnit setVariable [QGVAR(isHandcuffed), false, true];
[_oldUnit, false] call FUNC(setSurrendered);
};
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
@ -26,5 +26,5 @@ if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
};
if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then {
_oldUnit setVariable [QGVAR(isSurrendering), false, true];
[_oldUnit, false] call FUNC(setSurrendered);
};

View File

@ -0,0 +1,39 @@
/*
* Author: commy2 PabstMirror
* Fix, because captiveNum doesn't reset properly on respawn
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Corpse <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [alive, body] call ACE_captives_fnc_handleRespawn;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_dead);
if (!local _unit) exitWith {};
//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);
};

View File

@ -75,6 +75,7 @@ if (_state) then {
};
};
if (!alive _unit) exitWith {};
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
//if we are in "hands up" animationState, crack it now

View File

@ -38,7 +38,7 @@ _fnc_renderNearbyActions = {
// Only render them directly if they are base level actions
if (count (_x select 1) == 0) then {
// Try to render the menu
_action = [_x,[]];
_action = _x;
if ([_target, _action] call FUNC(renderBaseMenu)) then {
_numInteractions = _numInteractions + 1;
};

View File

@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if (((getPosASL ace_player) distance _setPosition) > 5) then {
_fncStatement = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
[ace_player, _attachedFence] call FUNC(cutDownFence);
PARAMS_3(_dummyTarget,_player,_attachedFence);
[_player, _attachedFence] call FUNC(cutDownFence);
};
_fncCondition = {
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))})
PARAMS_3(_dummyTarget,_player,_attachedFence);
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))})
};
{
@ -53,10 +53,10 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if ([_x] call FUNC(isFence)) then {
_fencesHelped pushBack _x;
_helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x);
[_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction);
_action = [QGVAR(helperCutFence), (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction);
[_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject);
_helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
_helper hideObject true;
_helper setVariable [QGVAR(attachedFence), _x];
_addedHelpers pushBack _helper;
};
};