added engine callclass
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40502
This commit is contained in:
parent
0655c1b34c
commit
745375f393
@ -24,6 +24,7 @@ ISmmPluginManager *g_pMMPlugins = NULL;
|
|||||||
CGlobalVars *gpGlobals = NULL;
|
CGlobalVars *gpGlobals = NULL;
|
||||||
ICvar *icvar = NULL;
|
ICvar *icvar = NULL;
|
||||||
IGameEventManager2 *gameevents = NULL;
|
IGameEventManager2 *gameevents = NULL;
|
||||||
|
CallClass<IVEngineServer> *enginePatch = NULL;
|
||||||
|
|
||||||
PLUGIN_EXPOSE(SourceMod, g_SourceMod_Core);
|
PLUGIN_EXPOSE(SourceMod, g_SourceMod_Core);
|
||||||
|
|
||||||
|
@ -51,6 +51,9 @@ extern ICvar *icvar;
|
|||||||
extern ISmmPluginManager *g_pMMPlugins;
|
extern ISmmPluginManager *g_pMMPlugins;
|
||||||
extern CGlobalVars *gpGlobals;
|
extern CGlobalVars *gpGlobals;
|
||||||
extern IGameEventManager2 *gameevents;
|
extern IGameEventManager2 *gameevents;
|
||||||
|
extern SourceHook::CallClass<IVEngineServer> *enginePatch;
|
||||||
|
|
||||||
|
#define ENGINE_CALL(func) SH_CALL(enginePatch, &IVEngineServer::func)
|
||||||
|
|
||||||
PLUGIN_GLOBALVARS();
|
PLUGIN_GLOBALVARS();
|
||||||
|
|
||||||
|
@ -156,6 +156,8 @@ void SourceModBase::StartSourceMod(bool late)
|
|||||||
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, this, &SourceModBase::LevelShutdown, false);
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, this, &SourceModBase::LevelShutdown, false);
|
||||||
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, this, &SourceModBase::GameFrame, false);
|
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, this, &SourceModBase::GameFrame, false);
|
||||||
|
|
||||||
|
enginePatch = SH_GET_CALLCLASS(engine);
|
||||||
|
|
||||||
/* Notify! */
|
/* Notify! */
|
||||||
SMGlobalClass *pBase = SMGlobalClass::head;
|
SMGlobalClass *pBase = SMGlobalClass::head;
|
||||||
while (pBase)
|
while (pBase)
|
||||||
@ -314,6 +316,12 @@ void SourceModBase::CloseSourceMod()
|
|||||||
pBase = pBase->m_pGlobalClassNext;
|
pBase = pBase->m_pGlobalClassNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (enginePatch)
|
||||||
|
{
|
||||||
|
SH_RELEASE_CALLCLASS(enginePatch);
|
||||||
|
enginePatch = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SourceModBase::LevelInit, false);
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SourceModBase::LevelInit, false);
|
||||||
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, this, &SourceModBase::LevelShutdown, false);
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, gamedll, this, &SourceModBase::LevelShutdown, false);
|
||||||
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, this, &SourceModBase::GameFrame, false);
|
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameFrame, gamedll, this, &SourceModBase::GameFrame, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user