2015-01-14 20:44:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Nou
|
|
|
|
* Execute a local event on this client only.
|
|
|
|
*
|
2015-09-18 16:28:19 +00:00
|
|
|
* Arguments:
|
2015-01-14 20:44:32 +00:00
|
|
|
* 0: Event name (string)
|
|
|
|
* 1: Event args (any)
|
|
|
|
*
|
2015-09-18 16:28:19 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-14 20:44:32 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-18 16:28:19 +00:00
|
|
|
params ["_eventName", "_eventArgs"];
|
2015-01-14 20:44:32 +00:00
|
|
|
|
2015-09-18 16:28:19 +00:00
|
|
|
GVAR(events) params ["_eventNames", "_eventArray"];
|
2015-05-14 22:12:40 +00:00
|
|
|
|
2015-09-18 16:28:19 +00:00
|
|
|
private "_eventIndex";
|
2015-01-14 20:44:32 +00:00
|
|
|
_eventIndex = _eventNames find _eventName;
|
2015-09-18 16:28:19 +00:00
|
|
|
|
|
|
|
if (_eventIndex != -1) then {
|
|
|
|
private "_events";
|
|
|
|
_events = _eventArray select _eventIndex;
|
|
|
|
|
2015-04-02 23:05:21 +00:00
|
|
|
#ifdef DEBUG_EVENTS
|
2015-08-26 15:39:44 +00:00
|
|
|
ACE_LOGINFO_1("* Local Event: %1",_eventName);
|
|
|
|
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
2015-04-02 23:05:21 +00:00
|
|
|
#endif
|
2015-08-26 13:20:11 +00:00
|
|
|
|
2015-01-14 20:44:32 +00:00
|
|
|
{
|
2015-09-18 16:28:19 +00:00
|
|
|
if (!isNil "_x") then {
|
|
|
|
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
|
|
|
|
|
2015-04-02 23:05:21 +00:00
|
|
|
#ifdef DEBUG_EVENTS_CALLSTACK
|
2015-08-26 15:39:44 +00:00
|
|
|
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
|
2015-04-02 23:05:21 +00:00
|
|
|
#endif
|
2015-01-14 20:44:32 +00:00
|
|
|
};
|
|
|
|
} forEach _events;
|
2015-08-26 13:20:11 +00:00
|
|
|
};
|