diff -r 9a76b1dffd40 -r 5f48300aa103 core/sourcemod.cpp --- a/core/sourcemod.cpp Thu Jan 18 21:07:10 2007 +0000 +++ b/core/sourcemod.cpp Thu Jan 18 23:28:14 2007 +0000 @@ -7,6 +7,7 @@ #include "PluginSys.h" #include "ShareSys.h" #include "CLogger.h" +#include "ExtensionSys.h" SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, false, bool, const char *, const char *, const char *, const char *, bool, bool); @@ -131,13 +132,11 @@ /* First initialize the global hooks we need */ SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SourceModBase::LevelInit, false); - m_IsLateLoadInMap = late; - /* Notify! */ SMGlobalClass *pBase = SMGlobalClass::head; while (pBase) { - pBase->OnSourceModStartup(m_IsLateLoadInMap); + pBase->OnSourceModStartup(false); pBase = pBase->m_pGlobalClassNext; } @@ -156,7 +155,6 @@ bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, char const *pOldLevel, char const *pLandmarkName, bool loadGame, bool background) { m_IsMapLoading = true; - m_IsLateLoadInMap = false; g_Logger.MapChange(pMapName); @@ -167,6 +165,11 @@ RETURN_META_VALUE(MRES_IGNORED, true); } +bool SourceModBase::IsMapLoading() +{ + return m_IsMapLoading; +} + void SourceModBase::DoGlobalPluginLoads() { char config_path[PLATFORM_MAX_PATH]; @@ -181,10 +184,17 @@ "%s/plugins", GetSMBaseDir()); + /* Run the first pass */ g_PluginSys.LoadAll_FirstPass(config_path, plugins_path); + /* Mark any extensions as loaded */ + g_Extensions.MarkAllLoaded(); + /* No modules yet, it's safe to call this from here */ g_PluginSys.LoadAll_SecondPass(); + + /* Re-mark any extensions as loaded */ + g_Extensions.MarkAllLoaded(); } void SourceModBase::CloseSourceMod() @@ -209,11 +219,6 @@ ShutdownJIT(); } -bool SourceModBase::IsLateLoadInMap() -{ - return m_IsLateLoadInMap; -} - const char *SourceModBase::GetSMBaseDir() { return m_SMBaseDir;