From 713f582a5b12bf98674229d5115399a125bc78bc Mon Sep 17 00:00:00 2001 From: oOKexOo Date: Sun, 10 Jun 2018 17:57:35 +0200 Subject: [PATCH] Revise paradrop: Drops below 150 => HALO (resolves #112) --- .../functions/features/fn_chute.sqf | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf index 214fe506..8fe99095 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_chute.sqf @@ -28,19 +28,29 @@ if (!isPlayer _unit) then moveOut _unit; unassignVehicle _unit; [_unit] orderGetIn false; - sleep 1; - // if the unit already has a chute - if (backpack _unit != "" and {getText (configfile >> "CfgVehicles" >> backpack _unit >> "backpackSimulation") isEqualTo "ParachuteSteerable"}) then + private _backpackClass = backpack _unit; + if (_backpackClass != "") then { + private _container = backpackContainer _unit; + private _weapon_cargo = getWeaponCargo _container; + private _magazine_cargo = getMagazineCargo _container; + private _item_cargo = getItemCargo _container; + removeBackpack _unit; + waitUntil {sleep 1; !alive _unit || getPos _unit select 2 < 150}; + private _chuteClass = ["b_parachute", _backpackClass] select (getText (configfile >> "CfgVehicles" >> _backpackClass >> "backpackSimulation") isEqualTo "ParachuteSteerable"); + _unit addBackpack _chuteClass; _unit action ["openParachute"]; + _unit addBackpack _backpackClass; + _container = backpackContainer _unit; + {_container addWeaponCargo [_x, (_weapon_cargo select 1) select _forEachIndex]} forEach (_weapon_cargo select 0); + {_container addMagazineCargo [_x, (_magazine_cargo select 1) select _forEachIndex]} forEach (_magazine_cargo select 0); + {_container addItemCargo [_x, (_item_cargo select 1) select _forEachIndex]} forEach (_item_cargo select 0); } else { - private _chute = "Steerable_Parachute_F" createVehicle [0,0,0]; - _chute setPos (getPos _unit); - _chute setDir (getDir _unit); - _chute setVelocity (velocity _unit); - _unit moveInDriver _chute; + waitUntil {sleep 1; !alive _unit || getPos _unit select 2 < 150}; + _unit addBackpack "b_parachute"; + _unit action ["openParachute"]; }; // prevent AI to be killed by fall damage waitUntil {isTouchingGround _unit or (!alive _unit)};