From 9a212f06874d9262307d8adde89ec4f3e361bafb Mon Sep 17 00:00:00 2001 From: Joko Date: Thu, 21 May 2015 14:54:00 +0200 Subject: [PATCH] Fix gettings anytime a new Parachute --- .../functions/fnc_storeParachute.sqf | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index ad90001349..f469384722 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -1,28 +1,30 @@ /* - * Author: joko // Jonas - * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit - * - * Arguments: - * None - * - * Return Value: - * 0: Unit - * 1: getAllGear-Array - * - * Example: - * None - * - * 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 == "") && !([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) && !(_unit getVariable [QGVAR(chuteIsCut),false])) then { - _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); -} else { - if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { - _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; - }; - _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))]; -}; \ No newline at end of file + * Author: joko // Jonas + * Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit + * + * Arguments: + * None + * + * Return Value: + * 0: Unit + * 1: getAllGear-Array + * + * Example: + * None + * + * 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 player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { + _unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); + } else { + if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { + _unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")]; + }; + if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && !(animationState _unit == 'para_pilot')) then { + _unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))]; + }; + }; \ No newline at end of file