Fix the reloading of game cache from settings.xml (#169)

std::is_same_v<decltype(0LL), int64_t> does not evaluate the same on
Linux Clang and MSVC. MSVC returns true but Clang and GCC both returns
false resulting in failing to read the game id from the XML file and
therefore rebuilding the cache.

Solution: Don't rely on the type of 0LL and 0ULL literals but explicitly
provide the type of the field we are trying to read.
This commit is contained in:
bitscher 2022-09-05 05:42:15 -07:00 committed by GitHub
parent a54a3ec74e
commit f2ec0b4083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,15 +160,15 @@ void CemuConfig::Load(XMLConfigParser& parser)
{ {
GameEntry entry{}; GameEntry entry{};
entry.rpx_file = boost::nowide::widen(rpx); entry.rpx_file = boost::nowide::widen(rpx);
entry.title_id = element.get("title_id", 0LL); entry.title_id = element.get<decltype(entry.title_id)>("title_id");
entry.legacy_name = boost::nowide::widen(element.get("name", "")); entry.legacy_name = boost::nowide::widen(element.get("name", ""));
entry.custom_name = element.get("custom_name", ""); entry.custom_name = element.get("custom_name", "");
entry.legacy_region = element.get("region", 0); entry.legacy_region = element.get("region", 0);
entry.legacy_version = element.get("version", 0); entry.legacy_version = element.get("version", 0);
entry.legacy_update_version = element.get("version", 0); entry.legacy_update_version = element.get("version", 0);
entry.legacy_dlc_version = element.get("dlc_version", 0); entry.legacy_dlc_version = element.get("dlc_version", 0);
entry.legacy_time_played = element.get("time_played", 0ULL); entry.legacy_time_played = element.get<decltype(entry.legacy_time_played)>("time_played");
entry.legacy_last_played = element.get("last_played", 0ULL); entry.legacy_last_played = element.get<decltype(entry.legacy_last_played)>("last_played");
entry.favorite = element.get("favorite", false); entry.favorite = element.get("favorite", false);
game_cache_entries.emplace_back(entry); game_cache_entries.emplace_back(entry);