aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/mods/compiled/modkeyvalues.cpp
diff options
context:
space:
mode:
authorunknown <for.oliver.kirkham@gmail.com>2023-02-11 03:08:43 +0000
committerunknown <for.oliver.kirkham@gmail.com>2023-02-11 03:08:43 +0000
commitc333ba84bee44549bb15675f353e04d22fb9f53c (patch)
treef62b52a47556e531ac43fad99149b743b96537a0 /NorthstarDLL/mods/compiled/modkeyvalues.cpp
parenta4e798b2778a8606f56cc78ce11a5889cf5a8b5a (diff)
downloadNorthstarLauncher-c333ba84bee44549bb15675f353e04d22fb9f53c.tar.gz
NorthstarLauncher-c333ba84bee44549bb15675f353e04d22fb9f53c.zip
commit for merge
Diffstat (limited to 'NorthstarDLL/mods/compiled/modkeyvalues.cpp')
-rw-r--r--NorthstarDLL/mods/compiled/modkeyvalues.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/NorthstarDLL/mods/compiled/modkeyvalues.cpp b/NorthstarDLL/mods/compiled/modkeyvalues.cpp
index 774be0eb..051b193e 100644
--- a/NorthstarDLL/mods/compiled/modkeyvalues.cpp
+++ b/NorthstarDLL/mods/compiled/modkeyvalues.cpp
@@ -25,14 +25,14 @@ void ModManager::TryBuildKeyValues(const char* filename)
// copy over patch kv files, and add #bases to new file, last mods' patches should be applied first
// note: #include should be identical but it's actually just broken, thanks respawn
- for (int64_t i = m_LoadedMods.size() - 1; i > -1; i--)
+ for (Mod& mod : GetMods() | std::views::reverse)
{
- if (!m_LoadedMods[i].m_bEnabled)
+ if (mod.m_bEnabled)
continue;
size_t fileHash = STR_HASH(normalisedPath);
- auto modKv = m_LoadedMods[i].KeyValues.find(fileHash);
- if (modKv != m_LoadedMods[i].KeyValues.end())
+ auto modKv = mod.KeyValues.find(fileHash);
+ if (modKv != mod.KeyValues.end())
{
// should result in smth along the lines of #include "mod_patch_5_mp_weapon_car.txt"
@@ -47,7 +47,7 @@ void ModManager::TryBuildKeyValues(const char* filename)
fs::remove(compiledDir / patchFilePath);
- fs::copy_file(m_LoadedMods[i].m_ModDirectory / "keyvalues" / filename, compiledDir / patchFilePath);
+ fs::copy_file(mod.m_ModDirectory / "keyvalues" / filename, compiledDir / patchFilePath);
}
}
@@ -100,8 +100,8 @@ void ModManager::TryBuildKeyValues(const char* filename)
overrideFile.m_pOwningMod = nullptr;
overrideFile.m_Path = normalisedPath;
- if (m_ModFiles.find(normalisedPath) == m_ModFiles.end())
- m_ModFiles.insert(std::make_pair(normalisedPath, overrideFile));
+ if (GetModFiles().find(normalisedPath) == GetModFiles().end())
+ GetModFiles().insert(std::make_pair(normalisedPath, overrideFile));
else
- m_ModFiles[normalisedPath] = overrideFile;
+ GetModFiles()[normalisedPath] = overrideFile;
}