mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix comments after code lines and avoid UI crash from empty comments
This commit is contained in:
parent
4a977d87dd
commit
5765655214
2 changed files with 13 additions and 4 deletions
|
@ -183,6 +183,11 @@ void CWCheatEngine::CreateCodeList() { //Creates code list to be used in functio
|
|||
if (initialCodesList[i].substr(0,2) == "_L") {
|
||||
if (cheatEnabled == true) {
|
||||
currentcode = initialCodesList[i];
|
||||
std::size_t comment = currentcode.find("//");
|
||||
if (comment != std::string::npos) {
|
||||
currentcode.erase(currentcode.begin() + comment, currentcode.end());
|
||||
//Purge comments after code lines before adding them to codelist
|
||||
}
|
||||
currentcode.erase(currentcode.begin(), currentcode.begin() + 3);
|
||||
codelist.push_back(currentcode);
|
||||
}
|
||||
|
|
|
@ -274,8 +274,10 @@ UI::EventReturn CwCheatScreen::OnCheckBox(UI::EventParams ¶ms) {
|
|||
void CwCheatScreen::processFileOn(std::string activatedCheat) {
|
||||
std::fstream fs;
|
||||
for (size_t i = 0; i < cheatList.size(); i++) {
|
||||
if (cheatList[i].substr(4) == activatedCheat) {
|
||||
cheatList[i] = "_C1 " + activatedCheat;
|
||||
if (cheatList[i].length() >= 4) {
|
||||
if (cheatList[i].substr(4) == activatedCheat) {
|
||||
cheatList[i] = "_C1 " + activatedCheat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,8 +295,10 @@ void CwCheatScreen::processFileOn(std::string activatedCheat) {
|
|||
void CwCheatScreen::processFileOff(std::string deactivatedCheat) {
|
||||
std::fstream fs;
|
||||
for (size_t i = 0; i < cheatList.size(); i++) {
|
||||
if (cheatList[i].substr(4) == deactivatedCheat) {
|
||||
cheatList[i] = "_C0 " + deactivatedCheat;
|
||||
if (cheatList[i].length() >= 4) {
|
||||
if (cheatList[i].substr(4) == deactivatedCheat) {
|
||||
cheatList[i] = "_C0 " + deactivatedCheat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue