diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index 4ae66d0d48..7167343dec 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -95,10 +95,17 @@ GameDatabaseSchema::GameEntry YamlGameDatabaseImpl::entryFromYaml(const std::str gameEntry.name = node["name"].as(""); gameEntry.region = node["region"].as(""); gameEntry.compat = static_cast(node["compat"].as(enum_cast(gameEntry.compat))); - gameEntry.eeRoundMode = static_cast(node["eeRoundMode"].as(enum_cast(gameEntry.eeRoundMode))); - gameEntry.vuRoundMode = static_cast(node["vuRoundMode"].as(enum_cast(gameEntry.vuRoundMode))); - gameEntry.eeClampMode = static_cast(node["eeClampMode"].as(enum_cast(gameEntry.eeClampMode))); - gameEntry.vuClampMode = static_cast(node["vuClampMode"].as(enum_cast(gameEntry.vuClampMode))); + // Safely grab round mode and clamp modes from the YAML, otherwise default t + if (YAML::Node roundModeNode = node["roundModes"]) + { + gameEntry.eeRoundMode = static_cast(roundModeNode["eeRoundMode"].as(enum_cast(gameEntry.eeRoundMode))); + gameEntry.vuRoundMode = static_cast(roundModeNode["vuRoundMode"].as(enum_cast(gameEntry.vuRoundMode))); + } + if (YAML::Node clampModeNode = node["clampModes"]) + { + gameEntry.eeClampMode = static_cast(clampModeNode["eeClampMode"].as(enum_cast(gameEntry.eeClampMode))); + gameEntry.vuClampMode = static_cast(clampModeNode["vuClampMode"].as(enum_cast(gameEntry.vuClampMode))); + } // Validate game fixes, invalid ones will be dropped! for (std::string& fix : node["gameFixes"].as>(std::vector()))