fixed Ocarina issue 689

This commit is contained in:
thedarkness1981 2009-07-15 02:01:10 +00:00
parent 1d48d64f72
commit e9ba1a1a0e

View File

@ -1110,17 +1110,23 @@ int MenuDiscList()
/* Open gct File and check exist */ /* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb"); 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); fseek (exeFile, 0, SEEK_END);
long size=ftell (exeFile); long size=ftell (exeFile);
rewind (exeFile); rewind (exeFile);
if (size>2056){ if (size>2056){
sprintf(nipple, "%s %s",nipple,tr("contains over 255 lines of code. It will produce unexpected results.")); 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); 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(); SDCard_deInit();
wiilight(0); wiilight(0);
@ -1172,21 +1178,28 @@ int MenuDiscList()
/* Open gct File and check exist */ /* Open gct File and check exist */
sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull); sprintf(nipple, "%s%s.gct",Settings.Cheatcodespath,IDfull);
exeFile = fopen (nipple ,"rb"); exeFile = fopen (nipple ,"rb");
fseek (exeFile, 0, SEEK_END); if (exeFile==NULL)
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.")); sprintf(nipple, "%s %s",nipple,tr("does not exist! Loading game without cheats."));
WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170); WindowPrompt(tr("Error"),nipple,NULL,NULL,NULL,NULL,170);
} }
} SDCard_deInit(); else
wiilight(0); {
returnHere = false; fseek (exeFile, 0, SEEK_END);
menu = MENU_EXIT; 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;
} }