diff --git a/core/EventManager.cpp b/core/EventManager.cpp index 9678f474..bba03d07 100644 --- a/core/EventManager.cpp +++ b/core/EventManager.cpp @@ -353,7 +353,7 @@ bool EventManager::OnFireEvent(IGameEvent *pEvent, bool bDontBroadcast) pForward->PushCell(bDontBroadcast); pForward->Execute(&res, NULL); - HandleSecurity sec = { NULL, g_pCoreIdent }; + HandleSecurity sec(NULL, g_pCoreIdent); g_HandleSys.FreeHandle(hndl, &sec); } @@ -407,7 +407,7 @@ bool EventManager::OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast) if (pHook->postCopy) { /* Free handle */ - HandleSecurity sec = { NULL, g_pCoreIdent }; + HandleSecurity sec(NULL, g_pCoreIdent); g_HandleSys.FreeHandle(hndl, &sec); /* Free event structure */ diff --git a/core/smn_events.cpp b/core/smn_events.cpp index 85bb8585..8d99a843 100644 --- a/core/smn_events.cpp +++ b/core/smn_events.cpp @@ -123,7 +123,7 @@ static cell_t sm_FireEvent(IPluginContext *pContext, const cell_t *params) g_EventManager.FireEvent(pInfo, params[2] ? true : false); /* Free handle on game event */ - HandleSecurity sec = {pContext->GetIdentity(), g_pCoreIdent}; + HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent); g_HandleSys.FreeHandle(hndl, &sec); return 1; @@ -150,7 +150,7 @@ static cell_t sm_CancelCreatedEvent(IPluginContext *pContext, const cell_t *para g_EventManager.CancelCreatedEvent(pInfo); /* Free handle on game event */ - HandleSecurity sec = {pContext->GetIdentity(), g_pCoreIdent}; + HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent); g_HandleSys.FreeHandle(hndl, &sec); return 1; diff --git a/core/vm/sp_vm_function.cpp b/core/vm/sp_vm_function.cpp index c571ec7f..89516c51 100644 --- a/core/vm/sp_vm_function.cpp +++ b/core/vm/sp_vm_function.cpp @@ -14,7 +14,7 @@ #include #include -#include "PluginSys.h" +#include "sp_vm_function.h" /******************** * FUNCTION CALLING * diff --git a/public/IHandleSys.h b/public/IHandleSys.h index a1dc7b6f..d68c93fd 100644 --- a/public/IHandleSys.h +++ b/public/IHandleSys.h @@ -157,6 +157,13 @@ namespace SourceMod */ struct HandleSecurity { + HandleSecurity() + { + } + HandleSecurity(IdentityToken_t *owner, IdentityToken_t *identity) + : pOwner(owner), pIdentity(identity) + { + } IdentityToken_t *pOwner; /**< Owner of the Handle */ IdentityToken_t *pIdentity; /**< Owner of the Type */ };