aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/squirrel.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
commitcfeeaf9561a294f359cc180b86f2644e3828d819 (patch)
tree4e2adfc4332f09b0ffd6b001c8e86313d5d47c46 /NorthstarDedicatedTest/squirrel.cpp
parent3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (diff)
downloadNorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.tar.gz
NorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.zip
reworking modloading code
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.cpp')
-rw-r--r--NorthstarDedicatedTest/squirrel.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/NorthstarDedicatedTest/squirrel.cpp b/NorthstarDedicatedTest/squirrel.cpp
index 5d8d69a2..48136f97 100644
--- a/NorthstarDedicatedTest/squirrel.cpp
+++ b/NorthstarDedicatedTest/squirrel.cpp
@@ -287,19 +287,19 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char
// todo: we need to verify if RunOn is valid for current state before calling callbacks
if (shouldCallCustomCallbacks)
{
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Enabled)
+ if (!mod.Enabled)
continue;
- for (ModScript* script : mod->Scripts)
+ for (ModScript script : mod.Scripts)
{
- for (ModScriptCallback* modCallback : script->Callbacks)
+ for (ModScriptCallback modCallback : script.Callbacks)
{
- if (modCallback->Context == realContext && modCallback->BeforeCallback.length())
+ if (modCallback.Context == realContext && modCallback.BeforeCallback.length())
{
- spdlog::info("Running custom {} script callback \"{}\"", GetContextName(realContext), modCallback->BeforeCallback);
- ClientCallScriptInitCallback(sqvm, modCallback->BeforeCallback.c_str());
+ spdlog::info("Running custom {} script callback \"{}\"", GetContextName(realContext), modCallback.BeforeCallback);
+ ClientCallScriptInitCallback(sqvm, modCallback.BeforeCallback.c_str());
}
}
}
@@ -314,19 +314,19 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char
// run after callbacks
if (shouldCallCustomCallbacks)
{
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Enabled)
+ if (!mod.Enabled)
continue;
- for (ModScript* script : mod->Scripts)
+ for (ModScript script : mod.Scripts)
{
- for (ModScriptCallback* modCallback : script->Callbacks)
+ for (ModScriptCallback modCallback : script.Callbacks)
{
- if (modCallback->Context == realContext && modCallback->AfterCallback.length())
+ if (modCallback.Context == realContext && modCallback.AfterCallback.length())
{
- spdlog::info("Running custom {} script callback \"{}\"", GetContextName(realContext), modCallback->AfterCallback);
- ClientCallScriptInitCallback(sqvm, modCallback->AfterCallback.c_str());
+ spdlog::info("Running custom {} script callback \"{}\"", GetContextName(realContext), modCallback.AfterCallback);
+ ClientCallScriptInitCallback(sqvm, modCallback.AfterCallback.c_str());
}
}
}
@@ -342,19 +342,19 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char
// todo: we need to verify if RunOn is valid for current state before calling callbacks
if (shouldCallCustomCallbacks)
{
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Enabled)
+ if (!mod.Enabled)
continue;
- for (ModScript* script : mod->Scripts)
+ for (ModScript script : mod.Scripts)
{
- for (ModScriptCallback* modCallback : script->Callbacks)
+ for (ModScriptCallback modCallback : script.Callbacks)
{
- if (modCallback->Context == SERVER && modCallback->BeforeCallback.length())
+ if (modCallback.Context == SERVER && modCallback.BeforeCallback.length())
{
- spdlog::info("Running custom {} script callback \"{}\"", GetContextName(context), modCallback->BeforeCallback);
- ServerCallScriptInitCallback(sqvm, modCallback->BeforeCallback.c_str());
+ spdlog::info("Running custom {} script callback \"{}\"", GetContextName(context), modCallback.BeforeCallback);
+ ServerCallScriptInitCallback(sqvm, modCallback.BeforeCallback.c_str());
}
}
}
@@ -369,19 +369,19 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char
// run after callbacks
if (shouldCallCustomCallbacks)
{
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Enabled)
+ if (!mod.Enabled)
continue;
- for (ModScript* script : mod->Scripts)
+ for (ModScript script : mod.Scripts)
{
- for (ModScriptCallback* modCallback : script->Callbacks)
+ for (ModScriptCallback modCallback : script.Callbacks)
{
- if (modCallback->Context == SERVER && modCallback->AfterCallback.length())
+ if (modCallback.Context == SERVER && modCallback.AfterCallback.length())
{
- spdlog::info("Running custom {} script callback \"{}\"", GetContextName(context), modCallback->AfterCallback);
- ServerCallScriptInitCallback(sqvm, modCallback->AfterCallback.c_str());
+ spdlog::info("Running custom {} script callback \"{}\"", GetContextName(context), modCallback.AfterCallback);
+ ServerCallScriptInitCallback(sqvm, modCallback.AfterCallback.c_str());
}
}
}