SPEC-2513 Fixes to enable w4457

This commit is contained in:
Esteban Papp
2021-06-04 10:51:47 -07:00
committed by GitHub
parent aa700fc97f
commit 76a6df341b
23 changed files with 124 additions and 125 deletions
+7 -7
View File
@@ -118,10 +118,10 @@ void CVarMenu::AddUniqueCVarsItem(QString displayName,
// Otherwise we could have just used the action's currently checked
// state and updated the CVar's value only
bool cVarOn = (cVar->GetFVal() == availableCVar.m_onValue);
bool checked = !cVarOn;
SetCVar(cVar, checked ? availableCVar.m_onValue : availableCVar.m_offValue);
action->setChecked(checked);
if (checked)
bool cVarChecked = !cVarOn;
SetCVar(cVar, cVarChecked ? availableCVar.m_onValue : availableCVar.m_offValue);
action->setChecked(cVarChecked);
if (cVarChecked)
{
// Set the rest of the CVars in the group to their off values
SetCVarsToOffValue(availableCVars, availableCVar);
@@ -132,9 +132,9 @@ void CVarMenu::AddUniqueCVarsItem(QString displayName,
// Initialize the action's checked state based on its associated CVar's current value
ICVar* cVar = gEnv->pConsole->GetCVar(availableCVar.m_cVarName.toUtf8().data());
bool checked = (cVar && cVar->GetFVal() == availableCVar.m_onValue);
action->setChecked(checked);
if (checked)
bool cVarChecked = (cVar && cVar->GetFVal() == availableCVar.m_onValue);
action->setChecked(cVarChecked);
if (cVarChecked)
{
// Set the rest of the CVars in the group to their off values
SetCVarsToOffValue(availableCVars, availableCVar);