From c7e0364342f2a5a44ce8a63e83915cbd68a4c2b1 Mon Sep 17 00:00:00 2001 From: Francesco Saltori Date: Tue, 20 Jan 2026 14:38:44 +0100 Subject: [PATCH] cheats: Fix previous cheats not being cleaned up when a game has no cheats file (#1640) --- src/core/cheats/cheats.cpp | 4 ---- src/core/cheats/gateway_cheat.cpp | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/cheats/cheats.cpp b/src/core/cheats/cheats.cpp index 2cdb75ad1..ebc783ad9 100644 --- a/src/core/cheats/cheats.cpp +++ b/src/core/cheats/cheats.cpp @@ -91,10 +91,6 @@ void CheatEngine::LoadCheatFile(u64 title_id) { FileUtil::CreateDir(cheat_dir); } - if (!FileUtil::Exists(filepath)) { - return; - } - auto gateway_cheats = GatewayCheat::LoadFile(filepath); { std::unique_lock lock{cheats_list_mutex}; diff --git a/src/core/cheats/gateway_cheat.cpp b/src/core/cheats/gateway_cheat.cpp index 176264b7d..b7cd229ac 100644 --- a/src/core/cheats/gateway_cheat.cpp +++ b/src/core/cheats/gateway_cheat.cpp @@ -487,6 +487,10 @@ std::string GatewayCheat::ToString() const { std::vector> GatewayCheat::LoadFile(const std::string& filepath) { std::vector> cheats; + if (!FileUtil::Exists(filepath)) { + return cheats; + } + boost::iostreams::stream file; FileUtil::OpenFStream(file, filepath); if (!file.is_open()) {