Merge branch 'main' of ssh+git://git.axiodl.com:6431/AxioDL/metaforce

This commit is contained in:
Phillip Stephens 2021-05-16 12:20:59 -07:00
commit 167b671596
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
3 changed files with 8 additions and 7 deletions

View File

@ -78,8 +78,7 @@ void CTweakGame::initCVars(hecl::CVarManager* mgr) {
constexpr hecl::CVar::EFlags skDefaultFlags = hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive; constexpr hecl::CVar::EFlags skDefaultFlags = hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive;
CREATE_CVAR(WorldPrefix, "", x4_worldPrefix, skDefaultFlags); CREATE_CVAR(WorldPrefix, "", x4_worldPrefix, skDefaultFlags);
CREATE_CVAR(FieldOfView, "", x24_fov, skDefaultFlags); CREATE_CVAR(FieldOfView, "", x24_fov, skDefaultFlags);
CREATE_CVAR(SplashScreensDisabled, "", x2b_splashScreensDisabled, CREATE_CVAR(SplashScreensDisabled, "", x2b_splashScreensDisabled, skDefaultFlags);
hecl::CVar::EFlags::Game | hecl::CVar::EFlags::Archive);
CREATE_CVAR(PressStartDelay, "", x30_pressStartDelay, skDefaultFlags); CREATE_CVAR(PressStartDelay, "", x30_pressStartDelay, skDefaultFlags);
CREATE_CVAR(WavecapIntensityNormal, "", x34_wavecapIntensityNormal, skDefaultFlags); CREATE_CVAR(WavecapIntensityNormal, "", x34_wavecapIntensityNormal, skDefaultFlags);
CREATE_CVAR(WavecapIntensityPoison, "", x38_wavecapIntensityPoison, skDefaultFlags); CREATE_CVAR(WavecapIntensityPoison, "", x38_wavecapIntensityPoison, skDefaultFlags);

View File

@ -218,10 +218,7 @@ bool CVar::toBoolean(bool* isValid) const {
return false; return false;
} }
if (isValid != nullptr) return athena::utility::parseBool(m_value, isValid);
*isValid = true;
return athena::utility::parseBool(m_value);
} }
int32_t CVar::toSigned(bool* isValid) const { int32_t CVar::toSigned(bool* isValid) const {

View File

@ -97,7 +97,11 @@ void CVarManager::deserialize(CVar* cvar) {
if (cvar->isBoolean() && val.empty()) { if (cvar->isBoolean() && val.empty()) {
// We were deferred without a value, assume true // We were deferred without a value, assume true
cvar->fromBoolean(true); cvar->fromBoolean(true);
} else if (!val.empty() && cvar->fromLiteralToType(val)) { cvar->m_wasDeserialized = true;
return;
}
if (!val.empty() && cvar->fromLiteralToType(val)) {
cvar->m_wasDeserialized = true;
return; return;
} }
} }
@ -327,6 +331,7 @@ void CVarManager::parseCommandLine(const std::vector<SystemString>& args) {
} else if (!cvarValue.empty()) { } else if (!cvarValue.empty()) {
cv->fromLiteralToType(cvarValue); cv->fromLiteralToType(cvarValue);
} }
cv->m_wasDeserialized = true;
athena::utility::tolower(cvarName); athena::utility::tolower(cvarName);
if (developerName == cvarName) if (developerName == cvarName)
/* Make sure we're not overriding developer mode when we restore */ /* Make sure we're not overriding developer mode when we restore */