2015-05-19 16:17:10 +00:00
|
|
|
/*
|
2015-05-21 12:54:00 +00:00
|
|
|
* 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
|
|
|
|
*/
|
2015-07-28 16:36:13 +00:00
|
|
|
#include "script_component.hpp"
|
2016-05-07 20:26:02 +00:00
|
|
|
|
|
|
|
params ["_unit", "_gear"];
|
2016-06-25 10:03:44 +00:00
|
|
|
private _backpack = backpack _unit;
|
2016-05-07 20:26:02 +00:00
|
|
|
|
|
|
|
if ((vehicle _unit) isKindOf "ParachuteBase" && {backpack _unit == ""} && {!(_unit getVariable [QGVAR(chuteIsCut),false])} && {_unit getVariable [QGVAR(hasReserve),false]}) then {
|
2015-07-28 18:08:38 +00:00
|
|
|
_unit addBackpackGlobal (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]);
|
2015-07-28 16:36:13 +00:00
|
|
|
} else {
|
2016-05-07 20:26:02 +00:00
|
|
|
if ((getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")) == 1) then {
|
2015-07-28 18:08:38 +00:00
|
|
|
_unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute"),true];
|
2015-07-28 16:36:13 +00:00
|
|
|
};
|
2016-05-07 20:26:02 +00:00
|
|
|
if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && {!(animationState _unit == 'para_pilot')}) then {
|
2015-07-28 18:08:38 +00:00
|
|
|
_unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute")),true];
|
2015-07-28 16:36:13 +00:00
|
|
|
};
|
|
|
|
};
|