mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/KoffeinFlummi/ACE3
This commit is contained in:
@ -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));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -21,6 +21,7 @@ PREP(handleGetOut);
|
|||||||
PREP(handleKilled);
|
PREP(handleKilled);
|
||||||
PREP(handleOnUnconscious);
|
PREP(handleOnUnconscious);
|
||||||
PREP(handlePlayerChanged);
|
PREP(handlePlayerChanged);
|
||||||
|
PREP(handleRespawn);
|
||||||
PREP(handleUnitInitPost);
|
PREP(handleUnitInitPost);
|
||||||
PREP(handleZeusDisplayChanged);
|
PREP(handleZeusDisplayChanged);
|
||||||
PREP(moduleSurrender);
|
PREP(moduleSurrender);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
PARAMS_1(_oldUnit);
|
PARAMS_1(_oldUnit);
|
||||||
|
|
||||||
if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then {
|
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 {
|
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 {
|
if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then {
|
||||||
_oldUnit setVariable [QGVAR(isSurrendering), false, true];
|
[_oldUnit, false] call FUNC(setSurrendered);
|
||||||
};
|
};
|
||||||
|
39
addons/captives/functions/fnc_handleRespawn.sqf
Normal file
39
addons/captives/functions/fnc_handleRespawn.sqf
Normal 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);
|
||||||
|
};
|
@ -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 (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
|
||||||
|
|
||||||
//if we are in "hands up" animationState, crack it now
|
//if we are in "hands up" animationState, crack it now
|
||||||
|
@ -38,7 +38,7 @@ _fnc_renderNearbyActions = {
|
|||||||
// Only render them directly if they are base level actions
|
// Only render them directly if they are base level actions
|
||||||
if (count (_x select 1) == 0) then {
|
if (count (_x select 1) == 0) then {
|
||||||
// Try to render the menu
|
// Try to render the menu
|
||||||
_action = [_x,[]];
|
_action = _x;
|
||||||
if ([_target, _action] call FUNC(renderBaseMenu)) then {
|
if ([_target, _action] call FUNC(renderBaseMenu)) then {
|
||||||
_numInteractions = _numInteractions + 1;
|
_numInteractions = _numInteractions + 1;
|
||||||
};
|
};
|
||||||
|
@ -40,12 +40,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
|
|||||||
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
||||||
|
|
||||||
_fncStatement = {
|
_fncStatement = {
|
||||||
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
|
PARAMS_3(_dummyTarget,_player,_attachedFence);
|
||||||
[ace_player, _attachedFence] call FUNC(cutDownFence);
|
[_player, _attachedFence] call FUNC(cutDownFence);
|
||||||
};
|
};
|
||||||
_fncCondition = {
|
_fncCondition = {
|
||||||
_attachedFence = _target getVariable [QGVAR(attachedFence), objNull];
|
PARAMS_3(_dummyTarget,_player,_attachedFence);
|
||||||
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))})
|
((!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 {
|
if ([_x] call FUNC(isFence)) then {
|
||||||
_fencesHelped pushBack _x;
|
_fencesHelped pushBack _x;
|
||||||
_helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _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 setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
|
||||||
_helper hideObject true;
|
_helper hideObject true;
|
||||||
_helper setVariable [QGVAR(attachedFence), _x];
|
|
||||||
_addedHelpers pushBack _helper;
|
_addedHelpers pushBack _helper;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user