From 174262904534eabef674e76cead1fa0eb1ee7c55 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 May 2016 15:26:02 -0500 Subject: [PATCH] Add NonSteerable Reserve Parachute (#3689) * Add NonSteerable Reserve Parachute Close #3364 * Use params --- addons/parachute/CfgVehicles.hpp | 7 ++++++- addons/parachute/functions/fnc_storeParachute.sqf | 13 +++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index ff9196ca60..4127bad166 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -83,7 +83,8 @@ class CfgVehicles { //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 ParachuteClass = "NonSteerable_Parachute_F"; - MACRO_HASRESERVE + ace_hasReserveParachute = 1; + ace_reserveParachute = "ACE_NonSteerableReserveParachute"; maximumLoad = 0; mass = 100; }; @@ -97,6 +98,10 @@ class CfgVehicles { ace_reserveParachute = ""; ace_hasReserveParachute = 0; }; + + class ACE_NonSteerableReserveParachute: ACE_ReserveParachute { + ParachuteClass = "NonSteerable_Parachute_F"; + }; class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";}; class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";}; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index 42ad18b304..55e887f3e6 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -15,16 +15,17 @@ * Public: No */ #include "script_component.hpp" -private ["_unit","_backpack"]; -_unit = _this select 0; -_backpack = (_this select 1) select 6; -if ((vehicle _unit) isKindOf "ParachuteBase" && backpack _unit == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) then { + +params ["_unit", "_gear"]; +private _backpack = _gear select 6; + +if ((vehicle _unit) isKindOf "ParachuteBase" && {backpack _unit == ""} && {!(_unit getVariable [QGVAR(chuteIsCut),false])} && {_unit getVariable [QGVAR(hasReserve),false]}) then { _unit addBackpackGlobal (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { - if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { + if ((getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")) == 1) then { _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute"),true]; }; - if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && !(animationState _unit == 'para_pilot')) then { + if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && {!(animationState _unit == 'para_pilot')}) then { _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")),true]; }; };