mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
ModSystem: fix unwanted double-nesting when writing status list
The keyvalues file is written incorrectly as we double nest the mod list by calling FindKey on "ModList" with the create parameter set. The constructor of KeyValues already creates the root object called "ModList" in which the list should be stored. The list is now properly parsed, making the enable/disable feature for individual mods work again.
This commit is contained in:
parent
eb374b4328
commit
e5b6e3eb6e
@ -135,8 +135,7 @@ void CModSystem::LoadModStatusList(CUtlMap<CUtlString, bool>& enabledList)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CModSystem::WriteModStatusList()
|
||||
{
|
||||
KeyValues kv = KeyValues("ModList");
|
||||
KeyValues* pModListKV = kv.FindKey("ModList", true);
|
||||
KeyValues kv("ModList");
|
||||
|
||||
FOR_EACH_VEC(m_ModList, i)
|
||||
{
|
||||
@ -146,7 +145,7 @@ void CModSystem::WriteModStatusList()
|
||||
if (mod->m_iState == eModState::ENABLED)
|
||||
enabled = true;
|
||||
|
||||
pModListKV->SetBool(mod->m_ModID.Get(), enabled);
|
||||
kv.SetBool(mod->m_ModID.Get(), enabled);
|
||||
}
|
||||
|
||||
CUtlBuffer buf = CUtlBuffer(ssize_t(0), 0, CUtlBuffer::TEXT_BUFFER);
|
||||
|
Loading…
x
Reference in New Issue
Block a user