2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Remove a unit info type event handler.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Type. Can be "Soldier", "Vehicle", "Aircraft" or "Parachute" (String)
|
|
|
|
* 1: ID of the event handler (Number)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None.
|
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
private ["_type", "_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
|
|
|
|
|
2015-01-12 04:02:33 +00:00
|
|
|
_type = format ["ACE_onLoadInfo%1", _this select 0];
|
2015-01-11 16:42:31 +00:00
|
|
|
_id = _this select 1;
|
|
|
|
|
|
|
|
_actionsVar = missionNamespace getVariable [_type, [-1, [], []]];
|
|
|
|
|
|
|
|
_currentId = _actionsVar select 0;
|
|
|
|
_actionIDs = _actionsVar select 1;
|
|
|
|
_actions = _actionsVar select 2;
|
|
|
|
|
|
|
|
_id = _actionIDs find _id;
|
|
|
|
|
|
|
|
if (_id == -1) exitWith {};
|
|
|
|
|
|
|
|
_actionIDs deleteAt _id;
|
|
|
|
_actions deleteAt _id;
|
|
|
|
|
|
|
|
missionNamespace setVariable [_type, [_currentId, _actionIDs, _actions]];
|