2018-09-17 19:19:29 +00:00
|
|
|
#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
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [[array]] call ace_fcs_fnc_handleAirBurstAummunitionPFH
|
|
|
|
*
|
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 {
|
2015-04-06 16:22:43 +00:00
|
|
|
[_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;
|