diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-05 22:43:56 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-11-05 22:43:56 +0000 |
commit | cfeeaf9561a294f359cc180b86f2644e3828d819 (patch) | |
tree | 4e2adfc4332f09b0ffd6b001c8e86313d5d47c46 /NorthstarDedicatedTest/keyvalues.cpp | |
parent | 3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (diff) | |
download | NorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.tar.gz NorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.zip |
reworking modloading code
Diffstat (limited to 'NorthstarDedicatedTest/keyvalues.cpp')
-rw-r--r-- | NorthstarDedicatedTest/keyvalues.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/keyvalues.cpp b/NorthstarDedicatedTest/keyvalues.cpp index 3bf4ff48..7afad20c 100644 --- a/NorthstarDedicatedTest/keyvalues.cpp +++ b/NorthstarDedicatedTest/keyvalues.cpp @@ -52,13 +52,13 @@ void ModManager::TryBuildKeyValues(const char* filename) // note: #include should be identical but it's actually just broken, thanks respawn for (int i = m_loadedMods.size() - 1; i > -1; i--) { - if (!m_loadedMods[i]->Enabled) + if (!m_loadedMods[i].Enabled) continue; size_t fileHash = std::hash<std::string>{}(normalisedPath); - for (int j = 0; j < m_loadedMods[i]->KeyValuesHash.size(); j++) + for (int j = 0; j < m_loadedMods[i].KeyValuesHash.size(); j++) { - if (fileHash == m_loadedMods[i]->KeyValuesHash[j]) + if (fileHash == m_loadedMods[i].KeyValuesHash[j]) { // should result in smth along the lines of #include "mod_patch_5_mp_weapon_car.txt" @@ -73,7 +73,7 @@ void ModManager::TryBuildKeyValues(const char* filename) 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); } } } @@ -123,9 +123,9 @@ void ModManager::TryBuildKeyValues(const char* filename) writeStream << newKvs; writeStream.close(); - ModOverrideFile* overrideFile = new ModOverrideFile; - overrideFile->owningMod = nullptr; - overrideFile->path = normalisedPath; + ModOverrideFile overrideFile; + overrideFile.owningMod = nullptr; + overrideFile.path = normalisedPath; if (m_modFiles.find(normalisedPath) == m_modFiles.end()) m_modFiles.insert(std::make_pair(normalisedPath, overrideFile)); |