Skip to content

Commit

Permalink
Revise paradrop: Drops below 150 => HALO (resolves #112)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexanone committed Jun 10, 2018
1 parent d562914 commit 713f582
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)};
Expand Down

0 comments on commit 713f582

Please sign in to comment.