aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/squirrel')
-rw-r--r--NorthstarDLL/squirrel/squirrel.cpp8
-rw-r--r--NorthstarDLL/squirrel/squirrel.h8
2 files changed, 7 insertions, 9 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp
index 4cf342db..4e64aecc 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;
@@ -471,7 +471,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;
@@ -498,7 +498,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)