diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-10-03 21:57:34 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-10-03 21:57:34 +0100 |
commit | c1b5d735410029ba734082563d8f3839bf519eca (patch) | |
tree | 6d5a7e21811f38feb25e43fa67c69dfec155f575 | |
parent | 22f22bdb68832d10f527941ea066d76834646655 (diff) | |
download | NorthstarLauncher-c1b5d735410029ba734082563d8f3839bf519eca.tar.gz NorthstarLauncher-c1b5d735410029ba734082563d8f3839bf519eca.zip |
only unrestrict dev commands when commandline flag is present
-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); |