From 6e67494db0556d4ba7a320771b6feaeebb52d8da Mon Sep 17 00:00:00 2001 From: pal1000 Date: Mon, 11 Nov 2013 12:01:44 +0200 Subject: [PATCH 1/3] Cwcheat: Allow comments in cheat files starting with // mainly for writing cheat usage guidelines --- Core/CwCheat.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 4d82886c99..cbd0bc2c20 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -114,7 +114,10 @@ void CWCheatEngine::CreateCodeList() { //Creates code list to be used in functio continue; //Line indicates Disc ID, not needed for cheats } if (initialCodesList[i].substr(0,2) == "_G") { - continue; //Line indicates game Title, also not needed for cheats. + continue; //Line indicates game Title, also not needed for cheats + } + if (initialCodesList[i].substr(0,2) == "//") { + continue; //Line indicates comment, also not needed for cheats. } if (initialCodesList[i].substr(0,3) == "_C1") { cheatEnabled = true; From 5efc4474b012f4cc556f86a9ba28505168dfa5e8 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Mon, 11 Nov 2013 17:14:21 +0200 Subject: [PATCH 2/3] Fixed pull 4510, this should work. --- Core/CwCheat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index cbd0bc2c20..76bf626275 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -234,7 +234,7 @@ std::vector CWCheatEngine::GetCodesList() { //Reads the entire chea } for (int i = 0; !list.eof(); i ++) { getline(list, line, '\n'); - if (line.length() > 3 && line.substr(0,1) == "_"){ + if (line.length() > 3 && (line.substr(0,1) == "_"||line.substr(0,2) == "//"){ codesList.push_back(line); } } From 6a894463b79fb965be46fe50c7cfb0c4a44b3bf9 Mon Sep 17 00:00:00 2001 From: pal1000 Date: Mon, 11 Nov 2013 17:23:37 +0200 Subject: [PATCH 3/3] Fixed missing ")" --- Core/CwCheat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 76bf626275..2c4ada35f3 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -234,7 +234,7 @@ std::vector CWCheatEngine::GetCodesList() { //Reads the entire chea } for (int i = 0; !list.eof(); i ++) { getline(list, line, '\n'); - if (line.length() > 3 && (line.substr(0,1) == "_"||line.substr(0,2) == "//"){ + if (line.length() > 3 && (line.substr(0,1) == "_"||line.substr(0,2) == "//")){ codesList.push_back(line); } }