ACE3/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

35 lines
740 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2
* Remove a map marker creation event handler.
*
* Arguments:
* 0: ID of the event handler <NUMBER>
*
* Return Value:
* None
*
* Example:
* [5] call ace_common_fnc_removeMapMarkerCreatedEventHandler
*
* Public: Yes
*/
params ["_id"];
private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]];
_actionsVar params ["_currentId", "_actionIDs", "_actions"];
_id = _actionIDs find _id;
if (_id == -1) exitWith {};
_actionIDs set [_id, -1];
_actionIDs = _actionIDs - [-1];
_actions set [_id, []];//{}
_actions = _actions - [[]];//[{}]
missionNamespace setVariable ["ACE_EventHandler_MapMarker", [_currentId, _actionIDs, _actions]];