mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-01 19:23:04 +00:00
Fix crashing on empy newlines. Increase max cheat list to 128
This commit is contained in:
parent
e6d371c675
commit
a2a3613457
@ -16,9 +16,6 @@ void hleCheat(u64 userdata, int cyclesLate);
|
|||||||
void trim2(std::string& str);
|
void trim2(std::string& str);
|
||||||
|
|
||||||
void __CheatInit() {
|
void __CheatInit() {
|
||||||
//Moved createFullPath to CheatInit from the constructor because it spams the log and constantly checks if exists. In here, only checks once.
|
|
||||||
|
|
||||||
// Cheats aren't working on Android yet - need to figure out the directory structure
|
|
||||||
gameTitle = g_paramSFO.GetValueString("DISC_ID");
|
gameTitle = g_paramSFO.GetValueString("DISC_ID");
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
activeCheatFile = g_Config.memCardDirectory + "PSP/Cheats/" + gameTitle + ".ini";
|
activeCheatFile = g_Config.memCardDirectory + "PSP/Cheats/" + gameTitle + ".ini";
|
||||||
@ -195,7 +192,9 @@ std::vector<std::string> CWCheatEngine::GetCodesList() { //Reads the entire chea
|
|||||||
std::ifstream list(activeCheatFile.c_str());
|
std::ifstream list(activeCheatFile.c_str());
|
||||||
for (int i = 0; !list.eof(); i ++) {
|
for (int i = 0; !list.eof(); i ++) {
|
||||||
getline(list, line, '\n');
|
getline(list, line, '\n');
|
||||||
codesList.push_back(line);
|
if (line.length() > 8){
|
||||||
|
codesList.push_back(line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for(size_t i = 0; i < codesList.size(); i++) {
|
for(size_t i = 0; i < codesList.size(); i++) {
|
||||||
trim2(codesList[i]);
|
trim2(codesList[i]);
|
||||||
@ -506,6 +505,10 @@ void CWCheatEngine::Run() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
UI::EventReturn OnCheckBox(UI::EventParams ¶ms);
|
UI::EventReturn OnCheckBox(UI::EventParams ¶ms);
|
||||||
|
|
||||||
bool enableCheat [64];
|
bool enableCheat [128];
|
||||||
std::vector<std::string> formattedList;
|
std::vector<std::string> formattedList;
|
||||||
std::vector<int> locations;
|
std::vector<int> locations;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user