diff -r ab92d2d7bdb8 -r 9886d8efdf7f core/sourcemod.cpp --- a/core/sourcemod.cpp Mon Feb 26 04:24:06 2007 +0000 +++ b/core/sourcemod.cpp Mon Feb 26 04:36:15 2007 +0000 @@ -25,6 +25,7 @@ #include "sm_stringutil.h" #include "CPlayerManager.h" #include "CTranslator.h" +#include "ForwardSys.h" SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool); SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, false); @@ -40,6 +41,7 @@ IdentityToken_t *g_pCoreIdent = NULL; float g_LastTime = 0.0f; float g_LastAuthCheck = 0.0f; +IForward *g_pOnGameFrame = NULL; typedef int (*GIVEENGINEPOINTER)(ISourcePawnEngine *); typedef unsigned int (*GETEXPORTCOUNT)(); @@ -203,6 +205,11 @@ g_Admins.DumpAdminCache(AdminCache_Overrides, true); g_Admins.DumpAdminCache(AdminCache_Groups, true); + if (!g_pOnGameFrame) + { + g_pOnGameFrame = g_Forwards.CreateForward("OnGameFrame", ET_Ignore, 0, NULL); + } + RETURN_META_VALUE(MRES_IGNORED, true); } @@ -223,6 +230,11 @@ } g_LastTime = curtime; } + + if (g_pOnGameFrame && g_pOnGameFrame->GetFunctionCount()) + { + g_pOnGameFrame->Execute(NULL); + } } void SourceModBase::LevelShutdown() @@ -296,6 +308,11 @@ void SourceModBase::CloseSourceMod() { + if (g_pOnGameFrame) + { + g_Forwards.ReleaseForward(g_pOnGameFrame); + } + /* Notify! */ SMGlobalClass *pBase = SMGlobalClass::head; while (pBase)