diff options
Diffstat (limited to 'NorthstarDLL/squirrel')
-rw-r--r-- | NorthstarDLL/squirrel/squirrel.cpp | 8 | ||||
-rw-r--r-- | NorthstarDLL/squirrel/squirrel.h | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp index 4771bf3f..60d0eab3 100644 --- a/NorthstarDLL/squirrel/squirrel.cpp +++ b/NorthstarDLL/squirrel/squirrel.cpp @@ -189,11 +189,11 @@ template <ScriptContext context> void SquirrelManager<context>::VMCreated(CSquir RegisterSquirrelFunc(m_pSQVM, funcReg, 1); } - for (auto& pair : g_pModManager->m_DependencyConstants) + for (auto& pair : g_pModManager->GetDependencyConstants()) { bool bWasFound = false; - for (Mod& dependency : g_pModManager->m_LoadedMods) + for (Mod& dependency : g_pModManager->GetMods()) { if (!dependency.m_bEnabled) continue; @@ -444,7 +444,7 @@ template <ScriptContext context> bool __fastcall CallScriptInitCallbackHook(void if (bShouldCallCustomCallbacks) { - for (Mod mod : g_pModManager->m_LoadedMods) + for (Mod& mod : g_pModManager->GetMods()) { if (!mod.m_bEnabled) continue; @@ -471,7 +471,7 @@ template <ScriptContext context> bool __fastcall CallScriptInitCallbackHook(void // run after callbacks if (bShouldCallCustomCallbacks) { - for (Mod mod : g_pModManager->m_LoadedMods) + for (Mod& mod : g_pModManager->GetMods()) { if (!mod.m_bEnabled) continue; diff --git a/NorthstarDLL/squirrel/squirrel.h b/NorthstarDLL/squirrel/squirrel.h index ce758d7c..65bda7e3 100644 --- a/NorthstarDLL/squirrel/squirrel.h +++ b/NorthstarDLL/squirrel/squirrel.h @@ -239,17 +239,15 @@ class SquirrelManagerBase { SQStackInfos stackInfo {}; if (1 + depth >= sqvm->_callstacksize) - { return nullptr; - } + sq_stackinfos(sqvm, 1 + depth, stackInfo); std::string sourceName = stackInfo._sourceName; std::replace(sourceName.begin(), sourceName.end(), '/', '\\'); std::string filename = "scripts\\vscripts\\" + sourceName; - if (auto res = g_pModManager->m_ModFiles.find(filename); res != g_pModManager->m_ModFiles.end()) - { + if (auto res = g_pModManager->GetModFiles().find(filename); res != g_pModManager->GetModFiles().end()) return res->second.m_pOwningMod; - } + return nullptr; } template <typename T> inline SQRESULT getuserdata(HSquirrelVM* sqvm, const SQInteger stackpos, T* data, uint64_t* typeId) |