ACE3/addons/missileguidance/functions/fnc_onIncomingMissile.sqf

27 lines
626 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2016-10-12 22:35:24 +00:00
/*
* Author: jaynus / nou
* Handles AI shooting a locking missile
*
* Arguments:
* 0: Target <OBJECT>
* 1: Ammo <STRING>
* 2: Shooter <OBJECT>
*
* Return Value:
* None
*
* Example:
* [cursorTarget, "x", player] call ace_missileguidance_fnc_onIncomingMissile;
2016-10-12 22:35:24 +00:00
*
* Public: No
*/
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
params ["_target", "_ammo", "_shooter"];
if (GVAR(enabled) < 1) exitWith {}; // bail if enabled
2016-05-30 16:37:03 +00:00
if !(local (gunner _shooter) || {local _shooter}) exitWith {}; // bail if not shooter
2016-10-12 22:35:24 +00:00
_shooter setVariable [QGVAR(vanilla_target),_target, false];
TRACE_2("setting vanilla target",_shooter,_target);