diff --git a/core/logic/ExtensionSys.cpp b/core/logic/ExtensionSys.cpp index 87f3c5e6..cb7b5f0e 100644 --- a/core/logic/ExtensionSys.cpp +++ b/core/logic/ExtensionSys.cpp @@ -1360,6 +1360,24 @@ void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount, } } +void CExtensionManager::CallOnCoreMapEnd() +{ + IExtensionInterface *pAPI; + List::iterator iter; + + for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++) + { + if ((pAPI = (*iter)->GetAPI()) == NULL) + { + continue; + } + if (pAPI->GetExtensionVersion() > 7) + { + pAPI->OnCoreMapEnd(); + } + } +} + const CVector *CExtensionManager::ListExtensions() { CVector *list = new CVector(); diff --git a/core/logic/ExtensionSys.h b/core/logic/ExtensionSys.h index 76dab140..33a40dcd 100644 --- a/core/logic/ExtensionSys.h +++ b/core/logic/ExtensionSys.h @@ -173,6 +173,7 @@ public: void AddLibrary(IExtension *pSource, const char *library); bool LibraryExists(const char *library); void CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax); + void CallOnCoreMapEnd(); void AddRawDependency(IExtension *ext, IdentityToken_t *other, void *iface); const CVector *ListExtensions(); void FreeExtensionList(const CVector *list); diff --git a/core/logic/intercom.h b/core/logic/intercom.h index 5d86853d..b28c5a91 100644 --- a/core/logic/intercom.h +++ b/core/logic/intercom.h @@ -211,6 +211,7 @@ public: virtual void AddRawDependency(IExtension *myself, IdentityToken_t *token, void *iface) = 0; virtual const CVector *ListExtensions() = 0; virtual void FreeExtensionList(const CVector *list) = 0; + virtual void CallOnCoreMapEnd() = 0; }; class AutoPluginList diff --git a/core/sourcemod.cpp b/core/sourcemod.cpp index f31b7af6..32fa99ff 100644 --- a/core/sourcemod.cpp +++ b/core/sourcemod.cpp @@ -395,6 +395,7 @@ void SourceModBase::LevelShutdown() { g_pOnMapEnd->Execute(NULL); } + extsys->CallOnCoreMapEnd(); g_Timers.RemoveMapChangeTimers(); diff --git a/public/IExtensionSys.h b/public/IExtensionSys.h index 3c63e7e3..8e008b0e 100644 --- a/public/IExtensionSys.h +++ b/public/IExtensionSys.h @@ -135,8 +135,9 @@ namespace SourceMod * * V6 - added TestFeature() to IShareSys. * V7 - added OnDependenciesDropped() to IExtensionInterface. + * V8 - added OnCoreMapEnd() to IExtensionInterface. */ - #define SMINTERFACE_EXTENSIONAPI_VERSION 7 + #define SMINTERFACE_EXTENSIONAPI_VERSION 8 /** * @brief The interface an extension must expose. @@ -325,6 +326,15 @@ namespace SourceMod virtual void OnDependenciesDropped() { } + + /** + * @brief Called on level shutdown + * + */ + + virtual void OnCoreMapEnd() + { + } }; /**