Merge pull request #127 from alliedmodders/coremapend
Add OnCoreMapEnd to extension's interface.
This commit is contained in:
commit
766b6e1770
@ -1360,6 +1360,24 @@ void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount,
|
||||
}
|
||||
}
|
||||
|
||||
void CExtensionManager::CallOnCoreMapEnd()
|
||||
{
|
||||
IExtensionInterface *pAPI;
|
||||
List<CExtension *>::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<IExtension *> *CExtensionManager::ListExtensions()
|
||||
{
|
||||
CVector<IExtension *> *list = new CVector<IExtension *>();
|
||||
|
@ -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<IExtension *> *ListExtensions();
|
||||
void FreeExtensionList(const CVector<IExtension *> *list);
|
||||
|
@ -211,6 +211,7 @@ public:
|
||||
virtual void AddRawDependency(IExtension *myself, IdentityToken_t *token, void *iface) = 0;
|
||||
virtual const CVector<IExtension *> *ListExtensions() = 0;
|
||||
virtual void FreeExtensionList(const CVector<IExtension *> *list) = 0;
|
||||
virtual void CallOnCoreMapEnd() = 0;
|
||||
};
|
||||
|
||||
class AutoPluginList
|
||||
|
@ -395,6 +395,7 @@ void SourceModBase::LevelShutdown()
|
||||
{
|
||||
g_pOnMapEnd->Execute(NULL);
|
||||
}
|
||||
extsys->CallOnCoreMapEnd();
|
||||
|
||||
g_Timers.RemoveMapChangeTimers();
|
||||
|
||||
|
@ -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()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user