Use GetCheatsFolder() to check the path correctly when non-default folder is set.

This commit is contained in:
Tokman5 2021-09-02 16:35:36 +09:00 committed by refractionpcsx2
parent 384f87b89c
commit c3c15a95c4
1 changed files with 2 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2010 PCSX2 Dev Team
* Copyright (C) 2002-2021 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
@ -247,10 +247,7 @@ int LoadPatchesFromDir(wxString name, const wxDirName& folderName, const wxStrin
wxString filespec = name + L"*.pnach";
loaded += _LoadPatchFiles(folderName, filespec, friendlyName, numberFoundPatchFiles);
// This comment _might_ be buggy. This function (LoadPatchesFromDir) loads from an explicit folder.
// This folder can be cheats or cheats_ws at either the default location or a custom one.
// This check only tests the default cheats folder, so the message it produces is possibly misleading.
if (folderName.ToString().IsSameAs(PathDefs::GetCheats().ToString()) && numberFoundPatchFiles == 0)
if (folderName.ToString().IsSameAs(GetCheatsFolder().ToString()) && numberFoundPatchFiles == 0)
{
wxString pathName = Path::Combine(folderName, name.MakeUpper() + L".pnach");
PatchesCon->WriteLn(Color_Gray, L"Not found %s file: %s", WX_STR(friendlyName), WX_STR(pathName));