From 55cac4b6d9288fe7e1579a3535313ce803ed4113 Mon Sep 17 00:00:00 2001 From: Joko Date: Tue, 28 Jul 2015 18:36:13 +0200 Subject: [PATCH] posible fix for #1932 --- addons/parachute/CfgVehicles.hpp | 52 +++++++++++++++++-- addons/parachute/XEH_postInit.sqf | 1 + .../parachute/functions/fnc_cutParachute.sqf | 2 +- .../functions/fnc_storeParachute.sqf | 28 +++++----- addons/parachute/script_component.hpp | 5 ++ 5 files changed, 70 insertions(+), 18 deletions(-) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 0999ba5c38..3d2b7bce11 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -28,11 +28,56 @@ class CfgVehicles { class Helicopter; class ParachuteBase: Helicopter { - ace_hasReserveParachute = 1; - ace_reserveParachute = "ACE_ReserveParachute"; + MACRO_HASRESERVE + }; + class ParachuteWest: ParachuteBase { + MACRO_HASRESERVE + }; + class ParachuteEast: ParachuteBase { + MACRO_HASRESERVE + }; + class ParachuteG: ParachuteBase { + MACRO_HASRESERVE + }; + class Parachute: ParachuteWest { + MACRO_HASRESERVE + }; + class NonSteerable_Parachute_F: Parachute { + MACRO_HASRESERVE + }; + class Paraglide: ParachuteWest{ + MACRO_HASRESERVE + }; + class Steerable_Parachute_F: Paraglide{ + MACRO_HASRESERVE + }; + class parachuteBase; + class Parachute_02_base_F: parachuteBase { + MACRO_HASRESERVE + }; + class B_Parachute_02_F: Parachute_02_base_F { + MACRO_HASRESERVE + }; + class O_Parachute_02_F: Parachute_02_base_F { + MACRO_HASRESERVE + }; + class I_Parachute_02_F: Parachute_02_base_F { + MACRO_HASRESERVE + }; + class BagBase; + class B_Parachute:BagBase { + MACRO_HASRESERVE + }; + class B_B_Parachute_02_F: B_Parachute { + MACRO_HASRESERVE + }; + class B_O_Parachute_02_F: B_Parachute { + MACRO_HASRESERVE + }; + class B_I_Parachute_02_F: B_Parachute { + MACRO_HASRESERVE }; - class B_Parachute; class ACE_NonSteerableParachute: B_Parachute { author = ECSTRING(common,ACETeam); scope = 2; @@ -41,6 +86,7 @@ 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 maximumLoad = 0; mass = 100; }; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 86626882e0..42f6baa89b 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -42,5 +42,6 @@ GVAR(PFH) = false; // don't show speed and height when in expert mode ["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); + //[ACE_Player,([ACE_player] call EFUNC(common,getAllGear))] call FUNC(storeParachute); ["playerInventoryChanged", FUNC(storeParachute) ] call EFUNC(common,addEventHandler); diff --git a/addons/parachute/functions/fnc_cutParachute.sqf b/addons/parachute/functions/fnc_cutParachute.sqf index e8300012c3..8c71f91ada 100644 --- a/addons/parachute/functions/fnc_cutParachute.sqf +++ b/addons/parachute/functions/fnc_cutParachute.sqf @@ -19,4 +19,4 @@ _unit = _this select 0; _vehicle = vehicle _unit; _unit action ["GetOut", _vehicle]; deleteVehicle _vehicle; -_unit setVariable [QGVAR(chuteIsCut), true]; \ No newline at end of file +_unit setVariable [QGVAR(chuteIsCut), true]; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index 45889b05b6..c117e3b896 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -14,17 +14,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 { - _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 +#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 { + _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"))]; + }; +}; diff --git a/addons/parachute/script_component.hpp b/addons/parachute/script_component.hpp index 0b0493b202..93a3e0d363 100644 --- a/addons/parachute/script_component.hpp +++ b/addons/parachute/script_component.hpp @@ -1,3 +1,4 @@ +#define DEBUG_ENABLED_PARACHUTE #define COMPONENT parachute #include "\z\ace\addons\main\script_mod.hpp" @@ -10,3 +11,7 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +#define MACRO_HASRESERVE ace_hasReserveParachute = 1; \ + ace_reserveParachute = "ACE_ReserveParachute";