From e9ba1a1a0eea360d33147f18989266a957ef5fd1 Mon Sep 17 00:00:00 2001 From: thedarkness1981 Date: Wed, 15 Jul 2009 02:01:10 +0000 Subject: [PATCH] fixed Ocarina issue 689 --- source/menu.cpp | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/source/menu.cpp b/source/menu.cpp index 02df1f6f..a61e72db 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -1110,17 +1110,23 @@ int MenuDiscList() /* Open gct File and check exist */ sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); exeFile = fopen (nipple ,"rb"); + + if (exeFile==NULL) + { + sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); + WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); + } + else + { fseek (exeFile, 0, SEEK_END); long size=ftell (exeFile); rewind (exeFile); if (size>2056){ sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); - }if (exeFile==NULL) - { - sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); - WindowPrompt(tr("Error"),nipple,tr("OK"),NULL,NULL,NULL,170); + } } + } SDCard_deInit(); wiilight(0); @@ -1172,21 +1178,28 @@ int MenuDiscList() /* Open gct File and check exist */ sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); exeFile = fopen (nipple ,"rb"); - fseek (exeFile, 0, SEEK_END); - long size=ftell (exeFile); - rewind (exeFile); - if (size>2056){ - sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); - WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); - }if (exeFile==NULL) + if (exeFile==NULL) { sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats.")); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); } - } SDCard_deInit(); - wiilight(0); - returnHere = false; - menu = MENU_EXIT; + else + { + fseek (exeFile, 0, SEEK_END); + long size=ftell (exeFile); + rewind (exeFile); + fclose(exeFile); + if (size>2056){ + sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); + WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); + } + } + + } + SDCard_deInit(); + wiilight(0); + returnHere = false; + menu = MENU_EXIT; }