aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/keyvalues.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-09-30 21:46:08 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-09-30 21:46:08 +0100
commit1ff8e068e62d095775ef2ae54d3685d89238f28c (patch)
tree5aedcc16f144c2225d7398dd1f19b4f11cd467c1 /NorthstarDedicatedTest/keyvalues.cpp
parent8b93a09f5b12ce7967df5824794ed24b3ff31cdc (diff)
downloadNorthstarLauncher-1ff8e068e62d095775ef2ae54d3685d89238f28c.tar.gz
NorthstarLauncher-1ff8e068e62d095775ef2ae54d3685d89238f28c.zip
small modmanager refactors
Diffstat (limited to 'NorthstarDedicatedTest/keyvalues.cpp')
-rw-r--r--NorthstarDedicatedTest/keyvalues.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/NorthstarDedicatedTest/keyvalues.cpp b/NorthstarDedicatedTest/keyvalues.cpp
index 3d527e62..61170177 100644
--- a/NorthstarDedicatedTest/keyvalues.cpp
+++ b/NorthstarDedicatedTest/keyvalues.cpp
@@ -53,9 +53,9 @@ void ModManager::TryBuildKeyValues(const char* filename)
for (int i = m_loadedMods.size() - 1; i > -1; i--)
{
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"
@@ -70,7 +70,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);
}
}
}
@@ -120,9 +120,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));