Add NonSteerable Reserve Parachute (#3689)

* Add NonSteerable Reserve Parachute

Close #3364

* Use params
This commit is contained in:
PabstMirror 2016-05-07 15:26:02 -05:00 committed by Glowbal
parent 8bd4afed6b
commit 1742629045
2 changed files with 13 additions and 7 deletions

View File

@ -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";};

View File

@ -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];
};
};