From f8531761c9f63754dea987e72c045392f15176ea Mon Sep 17 00:00:00 2001 From: LunaMoo Date: Mon, 20 Jun 2016 11:32:31 +0200 Subject: [PATCH] Fix #8448 properly, in case we fail to generate ID. Limit homebrew ini file generation to UI. --- Core/CwCheat.cpp | 4 +++- UI/CwCheatScreen.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index b524eda8a6a1..727fd7d5024a 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -39,7 +39,9 @@ static void __CheatStart() { gameTitle = g_paramSFO.GetValueString("DISC_ID"); - cheatEngine->CreateCheatFile(); + if (gameTitle != "") { //this only generates ini files on boot, let's leave homebrew ini file for UI + cheatEngine->CreateCheatFile(); + } cheatEngine = new CWCheatEngine(); cheatEngine->CreateCodeList(); diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index d26195df7f1e..f40c71c74fd7 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -214,6 +214,10 @@ UI::EventReturn CwCheatScreen::OnEditCheatFile(UI::EventParams ¶ms) { } UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) { + if (gameTitle.length() != 9) { + WARN_LOG(COMMON, "CWCHEAT: Incorrect ID(%s) - can't import cheats.", gameTitle); + return UI::EVENT_DONE; + } std::string line; std::vector title; bool finished = false, skip = false;