Added paramater to CreateEvent to determine whether or not creation should be forced even if nothing is hooking/listening to the event.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40719
This commit is contained in:
@@ -277,10 +277,10 @@ EventHookError EventManager::UnhookEvent(const char *name, IPluginFunction *pFun
|
||||
return EventHookErr_Okay;
|
||||
}
|
||||
|
||||
EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name)
|
||||
EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name, bool force)
|
||||
{
|
||||
EventInfo *pInfo;
|
||||
IGameEvent *pEvent = gameevents->CreateEvent(name, true);
|
||||
IGameEvent *pEvent = gameevents->CreateEvent(name, force);
|
||||
|
||||
if (pEvent)
|
||||
{
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public:
|
||||
public:
|
||||
EventHookError HookEvent(const char *name, IPluginFunction *pFunction, EventHookMode mode=EventHookMode_Post);
|
||||
EventHookError UnhookEvent(const char *name, IPluginFunction *pFunction, EventHookMode mode=EventHookMode_Post);
|
||||
EventInfo *CreateEvent(IPluginContext *pContext, const char *name);
|
||||
EventInfo *CreateEvent(IPluginContext *pContext, const char *name, bool force=false);
|
||||
void FireEvent(EventInfo *pInfo, bool bDontBroadcast=false);
|
||||
void CancelCreatedEvent(EventInfo *pInfo);
|
||||
private: // IGameEventManager2 hooks
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ static cell_t sm_CreateEvent(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pContext->LocalToString(params[1], &name);
|
||||
|
||||
pInfo = g_EventManager.CreateEvent(pContext, name);
|
||||
pInfo = g_EventManager.CreateEvent(pContext, name, params[2] ? true : false);
|
||||
|
||||
if (pInfo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user