aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptsrson.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
commitcfeeaf9561a294f359cc180b86f2644e3828d819 (patch)
tree4e2adfc4332f09b0ffd6b001c8e86313d5d47c46 /NorthstarDedicatedTest/scriptsrson.cpp
parent3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (diff)
downloadNorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.tar.gz
NorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.zip
reworking modloading code
Diffstat (limited to 'NorthstarDedicatedTest/scriptsrson.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptsrson.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NorthstarDedicatedTest/scriptsrson.cpp b/NorthstarDedicatedTest/scriptsrson.cpp
index 514d4f1c..0f6680a3 100644
--- a/NorthstarDedicatedTest/scriptsrson.cpp
+++ b/NorthstarDedicatedTest/scriptsrson.cpp
@@ -17,17 +17,17 @@ void ModManager::BuildScriptsRson()
std::string scriptsRson = ReadVPKOriginalFile(VPK_SCRIPTS_RSON_PATH);
scriptsRson += "\n\n// START MODDED SCRIPT CONTENT\n\n"; // newline before we start custom stuff
- for (Mod* mod : m_loadedMods)
+ for (Mod mod : m_loadedMods)
{
- if (!mod->Enabled)
+ if (!mod.Enabled)
continue;
// this isn't needed at all, just nice to have imo
scriptsRson += "// MOD: ";
- scriptsRson += mod->Name;
+ scriptsRson += mod.Name;
scriptsRson += ":\n\n";
- for (ModScript* script : mod->Scripts)
+ for (ModScript script : mod.Scripts)
{
/* should create something with this format for each script
When: "CONTEXT"
@@ -37,11 +37,11 @@ void ModManager::BuildScriptsRson()
]*/
scriptsRson += "When: \"";
- scriptsRson += script->RsonRunOn;
+ scriptsRson += script.RsonRunOn;
scriptsRson += "\"\n";
scriptsRson += "Scripts:\n[\n\t";
- scriptsRson += script->Path;
+ scriptsRson += script.Path;
scriptsRson += "\n]\n\n";
}
}
@@ -52,9 +52,9 @@ void ModManager::BuildScriptsRson()
writeStream << scriptsRson;
writeStream.close();
- ModOverrideFile* overrideFile = new ModOverrideFile;
- overrideFile->owningMod = nullptr;
- overrideFile->path = VPK_SCRIPTS_RSON_PATH;
+ ModOverrideFile overrideFile;
+ overrideFile.owningMod = nullptr;
+ overrideFile.path = VPK_SCRIPTS_RSON_PATH;
if (m_modFiles.find(VPK_SCRIPTS_RSON_PATH) == m_modFiles.end())
m_modFiles.insert(std::make_pair(VPK_SCRIPTS_RSON_PATH, overrideFile));