2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 22:05:03 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Checks whether the unit should preform landing.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ACE_Parachute_fnc_onEachFrame;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-02-02 20:52:08 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
private "_player";
|
2015-02-02 20:52:08 +00:00
|
|
|
_player = ACE_player;
|
2015-11-30 15:45:20 +00:00
|
|
|
if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);};
|
|
|
|
if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
|
|
|
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
|
|
|
if (isTouchingGround _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-02-02 21:58:24 +00:00
|
|
|
private ["_pos"];
|
|
|
|
_pos = getPosASL (vehicle _player);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then {
|
2015-11-30 15:45:20 +00:00
|
|
|
[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);
|
2015-04-06 16:22:43 +00:00
|
|
|
GVAR(PFH) = false;
|
2015-01-11 16:42:31 +00:00
|
|
|
// I believe this will not work for Zeus units.
|
2015-04-06 16:22:43 +00:00
|
|
|
deleteVehicle (vehicle _player);
|
|
|
|
[_player] call FUNC(doLanding);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|