Allow CVars to be set from the command line regardless of flags

This commit is contained in:
Phillip Stephens 2020-10-02 23:27:27 -07:00
parent 94e7bacd71
commit 185c79703e
1 changed files with 9 additions and 2 deletions

View File

@ -81,9 +81,11 @@ std::vector<CVar*> CVarManager::cvars(CVar::EFlags filter) const {
}
void CVarManager::deserialize(CVar* cvar) {
/* Make sure we're not trying to deserialize a CVar that is invalid or not exposed */
if (!cvar || (!cvar->isArchive() && !cvar->isInternalArchivable()))
/* Make sure we're not trying to deserialize a CVar that is invalid or not exposed, unless it's been specified on the
* command line (i.e deferred) */
if (!cvar) {
return;
}
/* First let's check for a deferred value */
std::string lowName = cvar->name().data();
@ -95,6 +97,11 @@ void CVarManager::deserialize(CVar* cvar) {
return;
}
/* Enforce isArchive and isInternalArchivable now that we've checked if it's been deferred */
if (!cvar->isArchive() && !cvar->isInternalArchivable()) {
return;
}
/* We were either unable to find a deferred value or got an invalid value */
#if _WIN32
hecl::SystemString filename =