2015-01-14 20:44:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Nou
|
|
|
|
* Remove an event handler.
|
|
|
|
*
|
|
|
|
* Argument:
|
2015-09-18 23:50:17 +00:00
|
|
|
* 0: Event name <STRING>
|
|
|
|
* 1: Event code <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
2015-01-14 20:44:32 +00:00
|
|
|
*
|
2015-09-29 22:14:21 +00:00
|
|
|
* Public: Yes
|
2015-01-14 20:44:32 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
2015-05-14 18:06:06 +00:00
|
|
|
|
2015-09-18 23:50:17 +00:00
|
|
|
params ["_eventName", "_eventCodeIndex"];
|
|
|
|
|
2016-02-06 20:18:01 +00:00
|
|
|
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
2015-09-18 23:50:17 +00:00
|
|
|
|
2016-02-06 20:18:01 +00:00
|
|
|
if (isNil "_eventFunctions") exitWith {TRACE_1("eventName not found",_eventName);};
|
|
|
|
if ((_eventCodeIndex < 0) || {(count _eventFunctions) <= _eventCodeIndex}) exitWith {TRACE_2("index out of bounds",_eventName,_eventCodeIndex);};
|
2015-05-14 18:06:06 +00:00
|
|
|
|
2016-02-06 20:18:01 +00:00
|
|
|
_eventFunctions set [_eventCodeIndex, nil];
|