Custom patches can be enabled/disabled like plugins

This commit is contained in:
nastys
2020-06-03 17:05:32 +02:00
parent e8ca90426e
commit 5bd406c1d9
3 changed files with 172 additions and 43 deletions
@@ -784,7 +784,8 @@ void ApplyPatches() {
for (std::filesystem::path p : std::filesystem::directory_iterator("../patches"))
{
std::string extension = std::filesystem::path(p).extension().string();
if (extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2")
if ((extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2") &&
GetPrivateProfileIntW(L"plugins", std::filesystem::path(p).filename().c_str(), TRUE, CONFIG_FILE))
{
std::cout << "[Patches] Reading custom patch file: " << std::filesystem::path(p).filename().string() << std::endl;
ApplyCustomPatches(std::filesystem::path(p).wstring());