mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
cheats: Fix previous cheats not being cleaned up when a game has no cheats file (#1640)
This commit is contained in:
parent
0805711cba
commit
c7e0364342
2 changed files with 4 additions and 4 deletions
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -487,6 +487,10 @@ std::string GatewayCheat::ToString() const {
|
|||
std::vector<std::shared_ptr<CheatBase>> GatewayCheat::LoadFile(const std::string& filepath) {
|
||||
std::vector<std::shared_ptr<CheatBase>> cheats;
|
||||
|
||||
if (!FileUtil::Exists(filepath)) {
|
||||
return cheats;
|
||||
}
|
||||
|
||||
boost::iostreams::stream<boost::iostreams::file_descriptor_source> file;
|
||||
FileUtil::OpenFStream<std::ios_base::in>(file, filepath);
|
||||
if (!file.is_open()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue