Change str.substr(x, 1) == "y" to str[x] == 'y'

This commit is contained in:
LunaMoo 2017-11-30 02:23:44 +01:00
parent 16057eda39
commit be18f2c3cc

View file

@ -342,15 +342,15 @@ std::vector<std::string> CWCheatEngine::GetCodesList() {
bool validCheatLine = false; bool validCheatLine = false;
// This code is used by cheat menu which doesn't support empty names // This code is used by cheat menu which doesn't support empty names
if (line.length() >= 5 && line.substr(0, 1) == "_") { if (line.length() >= 5 && line[0] == '_') {
for (int i = 4; i < line.length(); i++) { for (int i = 4; i < line.length(); i++) {
if (line.substr(i, 1) != " ") { if (line[i] != ' ') {
validCheatLine = true; validCheatLine = true;
break; break;
} }
} }
} }
if (validCheatLine || (line.length() >= 2 && line.substr(0, 2) == "//") || (line.length() >= 1 && line.substr(0, 1) == "#")) { if (validCheatLine || (line.length() >= 2 && line[0] == '/' && line[1] == '/') || (line.length() >= 1 && line[0] == '#')) {
codesList.push_back(TrimString(line)); codesList.push_back(TrimString(line));
} }
} }