diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-06 23:03:16 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-06 23:03:16 +0000 |
commit | a7fd103124d6e6a506d8f837b9a29a97f0ea7e63 (patch) | |
tree | 769af8a2be7890d42e1b3d183cdc9233ee9c969f /NorthstarDedicatedTest/keyvalues.cpp | |
parent | cfeeaf9561a294f359cc180b86f2644e3828d819 (diff) | |
download | NorthstarLauncher-a7fd103124d6e6a506d8f837b9a29a97f0ea7e63.tar.gz NorthstarLauncher-a7fd103124d6e6a506d8f837b9a29a97f0ea7e63.zip |
modmanager fixes
Diffstat (limited to 'NorthstarDedicatedTest/keyvalues.cpp')
-rw-r--r-- | NorthstarDedicatedTest/keyvalues.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/NorthstarDedicatedTest/keyvalues.cpp b/NorthstarDedicatedTest/keyvalues.cpp index 7afad20c..cada5cbe 100644 --- a/NorthstarDedicatedTest/keyvalues.cpp +++ b/NorthstarDedicatedTest/keyvalues.cpp @@ -56,25 +56,23 @@ void ModManager::TryBuildKeyValues(const char* filename) continue; size_t fileHash = std::hash<std::string>{}(normalisedPath); - for (int j = 0; j < m_loadedMods[i].KeyValuesHash.size(); j++) + auto modKv = m_loadedMods[i].KeyValues.find(fileHash); + if (modKv != m_loadedMods[i].KeyValues.end()) { - if (fileHash == m_loadedMods[i].KeyValuesHash[j]) - { - // should result in smth along the lines of #include "mod_patch_5_mp_weapon_car.txt" + // should result in smth along the lines of #include "mod_patch_5_mp_weapon_car.txt" - std::string patchFilePath = "mod_patch_"; - patchFilePath += std::to_string(patchNum++); - patchFilePath += "_"; - patchFilePath += kvPath.filename().string(); + std::string patchFilePath = "mod_patch_"; + patchFilePath += std::to_string(patchNum++); + patchFilePath += "_"; + patchFilePath += kvPath.filename().string(); - newKvs += "#base \""; - newKvs += patchFilePath; - newKvs += "\"\n"; + newKvs += "#base \""; + newKvs += patchFilePath; + newKvs += "\"\n"; - fs::remove(compiledDir / patchFilePath); + fs::remove(compiledDir / patchFilePath); - fs::copy_file(m_loadedMods[i].ModDirectory / "keyvalues" / filename, compiledDir / patchFilePath); - } + fs::copy_file(m_loadedMods[i].ModDirectory / "keyvalues" / filename, compiledDir / patchFilePath); } } |