ACE3/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf

39 lines
880 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-12-10 15:00:14 +00:00
/*
* Author: commy2
* Handle Air burst ammunition. Called from per frame handler.
*
* Arguments:
* -
*
* Return Value:
* None
*
* Example:
* [[array]] call ace_fcs_fnc_handleAirBurstAmmunitionPFH
*
2015-12-10 15:00:14 +00:00
* Public: No
*/
2015-05-13 03:15:52 +00:00
2015-12-10 15:00:14 +00:00
(_this select 0) params ["_vehicle", "_projectile", "_zeroing"];
2015-02-14 06:51:13 +00:00
2015-12-10 15:00:14 +00:00
// remove pfh if the projectile died before arriving
2015-02-14 06:51:13 +00:00
if (isNull _projectile || {!alive _projectile}) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
2015-02-14 06:51:13 +00:00
};
2015-12-10 15:00:14 +00:00
// wait if not there
2015-02-14 06:51:13 +00:00
if (_projectile distance _vehicle < _zeroing) exitWith {};
2015-12-10 15:00:14 +00:00
// explode
private _position = getPosATL _projectile;
private _subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
2015-02-14 06:51:13 +00:00
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];
deleteVehicle _projectile;
[_this select 1] call CBA_fnc_removePerFrameHandler;