From c1d9cbca647d20c5f6ede7ba8107097dc518f7bc Mon Sep 17 00:00:00 2001 From: notenergydrinks Date: Thu, 31 Jul 2025 16:55:14 +0200 Subject: [PATCH] [cheats] Check for comments in patch line loop (#156) My test case is this file, after line 27 is not marked as patch because it's after `@` tag but rest is patch lines including comments. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/156 Co-authored-by: notenergydrinks Co-committed-by: notenergydrinks --- src/core/file_sys/ips_layer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index d1ac24072e..57a9ce37d5 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp @@ -1,5 +1,5 @@ -// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later #include #include @@ -255,6 +255,11 @@ void IPSwitchCompiler::Parse() { const auto& patch_line = lines[++i]; + // Patch line may contain comments + if (StartsWith(patch_line, "//")) { + continue; + } + // Start of new patch if (StartsWith(patch_line, "@enabled") || StartsWith(patch_line, "@disabled")) { --i;