aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/modmanager.cpp
diff options
context:
space:
mode:
authorHappyDOGE <28511119+HappyDOGE@users.noreply.github.com>2022-01-03 14:33:16 +0300
committerHappyDOGE <28511119+HappyDOGE@users.noreply.github.com>2022-01-03 14:33:16 +0300
commitf3ffed0742d62adf48c37dca0acfad621724c21b (patch)
tree7e78b6f15bb4cd0f54fa982446061b0b39643e0c /NorthstarDedicatedTest/modmanager.cpp
parent2942ea56527100d5e39e0bbba4a1d16b1cde6128 (diff)
parent966f5052b7b59fc7200eb736c8d393056e0389cd (diff)
downloadNorthstarLauncher-f3ffed0742d62adf48c37dca0acfad621724c21b.tar.gz
NorthstarLauncher-f3ffed0742d62adf48c37dca0acfad621724c21b.zip
merge with upstream
Diffstat (limited to 'NorthstarDedicatedTest/modmanager.cpp')
-rw-r--r--NorthstarDedicatedTest/modmanager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/NorthstarDedicatedTest/modmanager.cpp b/NorthstarDedicatedTest/modmanager.cpp
index 4f4a2da0..23dd2d6e 100644
--- a/NorthstarDedicatedTest/modmanager.cpp
+++ b/NorthstarDedicatedTest/modmanager.cpp
@@ -22,7 +22,7 @@ Mod::Mod(fs::path modDir, char* jsonBuf)
ModDirectory = modDir;
- rapidjson::Document modJson;
+ rapidjson_document modJson;
modJson.Parse<rapidjson::ParseFlag::kParseCommentsFlag | rapidjson::ParseFlag::kParseTrailingCommasFlag>(jsonBuf);
// fail if parse error
@@ -309,7 +309,7 @@ void ModManager::LoadMods()
if (fs::is_regular_file(file))
{
std::string kvStr = file.path().lexically_relative(mod.ModDirectory / "keyvalues").lexically_normal().string();
- mod.KeyValues.insert(std::make_pair(std::hash<std::string>{}(kvStr), kvStr));
+ mod.KeyValues.emplace(std::hash<std::string>{}(kvStr), kvStr);
}
}
}
@@ -333,7 +333,7 @@ void ModManager::LoadMods()
}
// in a seperate loop because we register mod files in reverse order, since mods loaded later should have their files prioritised
- for (int i = m_loadedMods.size() - 1; i > -1; i--)
+ for (int64_t i = m_loadedMods.size() - 1; i > -1; i--)
{
if (!m_loadedMods[i].Enabled)
continue;
@@ -379,7 +379,7 @@ void ModManager::UnloadMods()
// should we be doing this here or should scripts be doing this manually?
// main issue with doing this here is when we reload mods for connecting to a server, we write enabled mods, which isn't necessarily what we wanna do
if (!m_enabledModsCfg.HasMember(mod.Name.c_str()))
- m_enabledModsCfg.AddMember(rapidjson::StringRef(mod.Name.c_str()), rapidjson::Value(false), m_enabledModsCfg.GetAllocator());
+ m_enabledModsCfg.AddMember(rapidjson_document::StringRefType(mod.Name.c_str()), rapidjson_document::GenericValue(false), m_enabledModsCfg.GetAllocator());
m_enabledModsCfg[mod.Name.c_str()].SetBool(mod.Enabled);
}