From 9dec8feed649024b04af82b4bf2875d1d4705664 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Feb 2023 16:29:29 +0000 Subject: local commit for merging main --- NorthstarDLL/engine/hoststate.cpp | 4 ++++ NorthstarDLL/mods/modmanager.cpp | 2 +- NorthstarDLL/mods/modmanager.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3