diff --git a/optionals/compat_rhs_usf3/CfgVehicles.hpp b/optionals/compat_rhs_usf3/CfgVehicles.hpp index d37fe7f09b..25ac08dfa0 100644 --- a/optionals/compat_rhs_usf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_usf3/CfgVehicles.hpp @@ -184,12 +184,6 @@ class CfgVehicles { condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); }; }; - - class EventHandlers: EventHandlers { - class RHSUSF_EventHandlers: RHSUSF_EventHandlers { - getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors}); - }; - }; }; class Helicopter_Base_H: Helicopter_Base_F { @@ -226,11 +220,6 @@ class CfgVehicles { condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); }; }; - class EventHandlers: EventHandlers { - class RHSUSF_EventHandlers { - getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors}); - }; - }; EQUIP_FRIES_ATTRIBUTE; }; @@ -266,6 +255,20 @@ class CfgVehicles { }; }; + class rhsusf_CH53E_USMC: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {{0,-9.5,2.6}}; + EGVAR(fastroping,onCut) = QFUNC(onCut); + EGVAR(fastroping,onPrepare) = QFUNC(onPrepare); + + class UserActions { + class RampOpen; + class RampClose: RampOpen { + condition = QUOTE([ARR_2(this,'ramp_bottom')] call FUNC(canCloseDoor)); + }; + }; + }; + class Heli_Attack_01_base_F: Helicopter_Base_F {}; class RHS_AH1Z_base: Heli_Attack_01_base_F { diff --git a/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf b/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf index 4aeecaffad..2395010624 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf @@ -18,19 +18,21 @@ #include "script_component.hpp" params ["_vehicle", "_door"]; -( - if (_vehicle isKindOf "RHS_CH_47F") then { - (_vehicle animationSourcePhase _door) > 0 - } else { - (_vehicle doorPhase _door) > 0 - } -) && -{alive _vehicle} && +(alive _vehicle) && {!(_vehicle getVariable [QEGVAR(fastroping,doorsLocked),false])} && { - if (_vehicle isKindOf "RHS_CH_47F") then { - ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]] - } else { - ACE_player in _vehicle + switch (true) do { + case (_vehicle isKindOf "rhsusf_CH53E_USMC"): { + ((_vehicle animationPhase _door) > 0) && + {ACE_player == (driver _vehicle)} + }; + case (_vehicle isKindOf "RHS_CH_47F"): { + ((_vehicle animationSourcePhase _door) > 0) && + {ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]]} + }; + default { + ((_vehicle doorPhase _door) > 0) && + {ACE_player in _vehicle} + }; } } diff --git a/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf b/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf index 1201d3ee18..8cbf1e2450 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf @@ -26,11 +26,15 @@ if !(isNull _fries) then { [{ _this animateDoor ["doorRB", 0]; _this animateDoor ["doorLB", 0]; + _this animate ["doorHandler_R",0]; + _this animate ["doorHandler_L",0]; }, _vehicle, 2] call CBA_fnc_waitAndExecute; 4 } else { _vehicle animateDoor ["ramp_anim", 0]; + _vehicle animate ["ramp_bottom",0]; + _vehicle animate ["ramp_top",0]; 2 }; diff --git a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf index 4bc7c03524..2adb6f2b5e 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf @@ -23,7 +23,11 @@ private _waitTime = 2; _vehicle animateDoor ["doorRB", 1]; _vehicle animateDoor ["doorLB", 1]; +_vehicle animate ["doorHandler_R",1]; +_vehicle animate ["doorHandler_L",1]; _vehicle animateDoor ["ramp_anim", 1]; +_vehicle animate ["ramp_bottom",0.56]; +_vehicle animate ["ramp_top",1]; private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull]; if !(isNull _fries) then {