ACE3/addons/common/functions/fnc_removeCameraEventHandler.sqf

35 lines
752 B
Plaintext
Raw Normal View History

/*
* Author: commy2
*
* Remove a camera view event handler.
*
* Argument:
* 0: ID of the event handler (Number)
*
* Return value:
* None.
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"];
_id = _this select 0;
_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]];
_currentId = _actionsVar select 0;
_actionIDs = _actionsVar select 1;
_actions = _actionsVar select 2;
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs set [_id, -1];
_actionIDs = _actionIDs - [-1];
_actions set [_id, []];//{}
_actions = _actions - [[]];//[{}]
missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_currentId, _actionIDs, _actions]];