ACE3/addons/disposable/functions/fnc_aiDropWeaponCallback.sqf
2015-01-13 19:30:25 -06:00

30 lines
690 B
Plaintext

/*
* Author: bux, commy2
*
* Remove the ai's missle launcher tube
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_unit", "_tube", "_projectile", "_logic"];
_unit = (_this select 0) select 0;
_tube = (_this select 0) select 1;
_projectile = (_this select 0) select 2;
if (!isNull _projectile) exitWith {};
//remove frameEH
[(_this select 1)] call cba_fnc_removePerFrameHandler;
//If AI still has tube, throw it on ground
if (secondaryWeapon _unit == _tube) then {
_logic = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"];
_logic addWeaponCargoGlobal [_tube, 1]; // @todo secondary weapon items
_unit removeWeapon _tube;
};