diff --git a/core/EventManager.cpp b/core/EventManager.cpp index cf5e14fb..db97f207 100644 --- a/core/EventManager.cpp +++ b/core/EventManager.cpp @@ -25,7 +25,7 @@ SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent *, const ParamType GAMEEVENT_PARAMS[] = {Param_Cell, Param_String, Param_Cell}; typedef List EventHookList; -EventManager::EventManager() : m_EventType(0), m_NotifyPlugins(true) +EventManager::EventManager() : m_EventType(0) { /* Create an event lookup trie */ m_EventHooks = sm_trie_create(); @@ -302,11 +302,8 @@ EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name) return NULL; } -void EventManager::FireEvent(EventInfo *pInfo, int flags, bool bDontBroadcast) +void EventManager::FireEvent(EventInfo *pInfo, bool bDontBroadcast) { - /* Should SourceMod plugins be notified of this event? */ - m_NotifyPlugins = (flags & EVENT_PASSTHRU_ALL) ? true : false; - /* Actually fire event now */ gameevents->FireEvent(pInfo->pEvent, bDontBroadcast); @@ -336,11 +333,6 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast) IChangeableForward *pForward; const char *name; cell_t res = Pl_Continue; - - if (!m_NotifyPlugins) - { - RETURN_META_VALUE(MRES_IGNORED, true); - } /* Get the event name, we're going to need this for passing to post hooks */ name = pEvent->GetName(); @@ -389,14 +381,6 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast) const char *name; Handle_t hndl = 0; - if (!m_NotifyPlugins) - { - /* Reset plugin notification state */ - m_NotifyPlugins = true; - - RETURN_META_VALUE(MRES_IGNORED, true); - } - name = m_EventNames.front(); if (sm_trie_retrieve(m_EventHooks, name, reinterpret_cast(&pHook))) diff --git a/core/EventManager.h b/core/EventManager.h index e0ab28da..0c796284 100644 --- a/core/EventManager.h +++ b/core/EventManager.h @@ -26,9 +26,6 @@ using namespace SourceHook; -//#define EVENT_PASSTHRU (1<<0) -#define EVENT_PASSTHRU_ALL (1<<1) - struct EventInfo { IGameEvent *pEvent; @@ -97,14 +94,13 @@ 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); - void FireEvent(EventInfo *pInfo, int flags=0, bool bDontBroadcast=false); + void FireEvent(EventInfo *pInfo, bool bDontBroadcast=false); void CancelCreatedEvent(EventInfo *pInfo); private: // IGameEventManager2 hooks bool OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast); bool OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast); private: HandleType_t m_EventType; - bool m_NotifyPlugins; Trie *m_EventHooks; CStack m_FreeEvents; CStack m_EventNames; diff --git a/core/smn_events.cpp b/core/smn_events.cpp index b3cc7508..95a2648d 100644 --- a/core/smn_events.cpp +++ b/core/smn_events.cpp @@ -99,7 +99,7 @@ static cell_t sm_FireEvent(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("Game event \"%s\" could not be fired because it was not created by this plugin", pInfo->pEvent->GetName()); } - g_EventManager.FireEvent(pInfo, params[2], params[3] ? true : false); + g_EventManager.FireEvent(pInfo, params[2] ? true : false); /* Free handle on game event */ HandleSecurity sec = {pContext->GetIdentity(), g_pCoreIdent}; diff --git a/plugins/include/events.inc b/plugins/include/events.inc index ba1f297c..34088948 100644 --- a/plugins/include/events.inc +++ b/plugins/include/events.inc @@ -18,11 +18,6 @@ #endif #define _events_included -/** - * Flags for firing game events - */ -#define EVENT_PASSTHRU_ALL (1<<1) /**< Event will pass through other SourceMM plugins AND SourceMod */ - /** * Event hook modes determining how hooking should be handled */ @@ -94,12 +89,11 @@ native Handle:CreateEvent(const String:name[]); * Fires a game event. * * @param event Handle to the event. - * @param flags Optional bitstring flags. See EVENT_* constants for more details. * @param dontBroadcast Optional boolean that determines if event should be broadcast to clients. * @noreturn * @error Invalid or corrupt Handle. */ -native FireEvent(Handle:event, flags=0, bool:dontBroadcast=false); +native FireEvent(Handle:event, bool:dontBroadcast=false); /** * Cancels a previously created game event that has not been fired.