diff options
-rw-r--r-- | NorthstarDLL/host.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/NorthstarDLL/host.cpp b/NorthstarDLL/host.cpp index e8cb9bdc..732d2631 100644 --- a/NorthstarDLL/host.cpp +++ b/NorthstarDLL/host.cpp @@ -21,30 +21,33 @@ void, __fastcall, (bool bDedicated)) for (auto& cvar : mod.ConVars) vModConvarNames.push_back(cvar->Name); - // strip hidden and devonly cvar flags - int iNumCvarsAltered = 0; - for (auto& pair : R2::g_pCVar->DumpToMap()) - { - // don't remove from mod cvars - if (std::find(vModConvarNames.begin(), vModConvarNames.end(), pair.second->m_pszName) != vModConvarNames.end()) - continue; + if (Tier0::CommandLine()->CheckParm("-allowdevcvars")) + { + // strip hidden and devonly cvar flags + int iNumCvarsAltered = 0; + for (auto& pair : R2::g_pCVar->DumpToMap()) + { + // don't remove from mod cvars + if (std::find(vModConvarNames.begin(), vModConvarNames.end(), pair.second->m_pszName) != vModConvarNames.end()) + continue; - // strip flags - int flags = pair.second->GetFlags(); - if (flags & FCVAR_DEVELOPMENTONLY) - { - flags &= ~FCVAR_DEVELOPMENTONLY; - iNumCvarsAltered++; - } + // strip flags + int flags = pair.second->GetFlags(); + if (flags & FCVAR_DEVELOPMENTONLY) + { + flags &= ~FCVAR_DEVELOPMENTONLY; + iNumCvarsAltered++; + } - if (flags & FCVAR_HIDDEN) - { - flags &= ~FCVAR_HIDDEN; - iNumCvarsAltered++; - } + if (flags & FCVAR_HIDDEN) + { + flags &= ~FCVAR_HIDDEN; + iNumCvarsAltered++; + } - pair.second->m_nFlags = flags; - } + pair.second->m_nFlags = flags; + } + } spdlog::info("Removed {} hidden/devonly cvar flags", iNumCvarsAltered); |