aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <for.oliver.kirkham@gmail.com>2023-02-13 16:29:29 +0000
committerunknown <for.oliver.kirkham@gmail.com>2023-02-13 16:29:29 +0000
commit9dec8feed649024b04af82b4bf2875d1d4705664 (patch)
treeda7cd19f72a1d2dc4813d810c4e4aa1be981b068
parent56372efa9706898c8646376182b544bc6350c5c7 (diff)
downloadNorthstarLauncher-9dec8feed649024b04af82b4bf2875d1d4705664.tar.gz
NorthstarLauncher-9dec8feed649024b04af82b4bf2875d1d4705664.zip
local commit for merging main
-rw-r--r--NorthstarDLL/engine/hoststate.cpp4
-rw-r--r--NorthstarDLL/mods/modmanager.cpp2
-rw-r--r--NorthstarDLL/mods/modmanager.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/NorthstarDLL/engine/hoststate.cpp b/NorthstarDLL/engine/hoststate.cpp
index 4900539b..d89e6c12 100644
--- a/NorthstarDLL/engine/hoststate.cpp
+++ b/NorthstarDLL/engine/hoststate.cpp
@@ -134,6 +134,10 @@ void, __fastcall, (CHostState* self))
g_pServerPresence->SetMap(g_pHostState->m_levelName);
}
+// TODO: due to exception in code for singleplayer (see connect command) this func will never run
+// when connect is ran on the ip localhost, while connected to a local listen server
+// i dont really care
+
// clang-format off
AUTOHOOK(CHostState__State_GameShutdown, engine.dll + 0x16E640,
void, __fastcall, (CHostState* self))
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp
index 1c3c416d..d2321583 100644
--- a/NorthstarDLL/mods/modmanager.cpp
+++ b/NorthstarDLL/mods/modmanager.cpp
@@ -1039,7 +1039,7 @@ void ModManager::SaveEnabledMods()
enabledModsCfg.SetObject();
// add values
- for (Mod& mod : GetMods())
+ for (Mod& mod : GetMods() | FilterLocal)
enabledModsCfg.AddMember(rapidjson_document::StringRefType(mod.Name.c_str()), mod.m_bEnabled, enabledModsCfg.GetAllocator());
// write
diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h
index 0bb696e8..ea5c4105 100644
--- a/NorthstarDLL/mods/modmanager.h
+++ b/NorthstarDLL/mods/modmanager.h
@@ -225,6 +225,8 @@ class ModManager
// for std::views::filter, e.g. for (Mod& mod : g_pModManager::GetMods() | ModManager::FilterEnabled)
static inline constexpr auto FilterEnabled = std::views::filter([](Mod& mod) { return mod.m_bEnabled; });
+ static inline constexpr auto FilterRemote = std::views::filter([](Mod& mod) { return mod.m_bRemote; });
+ static inline constexpr auto FilterLocal = std::views::filter([](Mod& mod) { return !mod.m_bRemote; });
};
fs::path GetModFolderPath();