diff -r 6f9b8bab7ae8 -r 8a5d1da7dd18 core/sourcemod.cpp --- a/core/sourcemod.cpp Wed May 02 17:45:09 2007 +0000 +++ b/core/sourcemod.cpp Wed May 02 17:49:23 2007 +0000 @@ -45,6 +45,7 @@ float g_LastTime = 0.0f; float g_LastAuthCheck = 0.0f; IForward *g_pOnGameFrame = NULL; +IForward *g_pOnMapEnd = NULL; bool g_Loaded = false; typedef int (*GIVEENGINEPOINTER)(ISourcePawnEngine *); @@ -288,6 +289,11 @@ g_pOnGameFrame = g_Forwards.CreateForward("OnGameFrame", ET_Ignore, 0, NULL); } + if (!g_pOnMapEnd) + { + g_pOnMapEnd = g_Forwards.CreateForward("OnMapEnd", ET_Ignore, 0, NULL); + } + RETURN_META_VALUE(MRES_IGNORED, true); } @@ -319,6 +325,11 @@ void SourceModBase::LevelShutdown() { + if (g_pOnMapEnd) + { + g_pOnMapEnd->Execute(NULL); + } + if (m_ExecPluginReload) { g_PluginSys.ReloadOrUnloadPlugins(); @@ -396,6 +407,11 @@ { g_Forwards.ReleaseForward(g_pOnGameFrame); } + + if (g_pOnMapEnd) + { + g_Forwards.ReleaseForward(g_pOnMapEnd); + } /* Notify! */ SMGlobalClass *pBase = SMGlobalClass::head;