mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-04-08 02:11:29 -06: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
@ -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…
Reference in New Issue
Block a user