diff --git a/src/hqp/hq_sound.cpp b/src/hqp/hq_sound.cpp
index 32a08732b..e08e57248 100644
--- a/src/hqp/hq_sound.cpp
+++ b/src/hqp/hq_sound.cpp
@@ -26,7 +26,9 @@ short HQSndDrv_Load(SDL_AudioSpec *AudioSpec, stHQSound *psound, const std::stri
#ifdef BUILD_WITH_OGG
if(openOGGSound(fp, &AudioFileSpec, AudioSpec->format, psound) != 0)
{
- g_pLogFile->ftextOut(PURPLE,"OGG file could not be opened: \"%s\". The file was detected, but appears to be damaged. Trying to load the classical sound
", soundfile.c_str());
+ std::string buf2;
+ buf2 = "OGG file \"" + buf +"\"could not be opened. The file was detected, but appears to be damaged. Trying to load the classical sound
";
+ g_pLogFile->ftextOut(PURPLE,buf2.c_str());
return 1;
}
psound->enabled = true;
diff --git a/src/include/menu.h b/src/include/menu.h
index 55774d352..0a88dc501 100644
--- a/src/include/menu.h
+++ b/src/include/menu.h
@@ -17,7 +17,7 @@
char controlsmenu(stCloneKeenPlus *pCKP);
int mainmenu(stCloneKeenPlus *pCKP,int defaultopt);
char configmenu(stCloneKeenPlus *pCKP);
-short loadStartMenu(stCloneKeenPlus *pCKP);
+bool loadStartMenu(stCloneKeenPlus *pCKP);
void keensleft(stCloneKeenPlus *pCKP);
void showmapatpos(int level, int xoff, int yoff, int wm, stCloneKeenPlus *pCKP);
short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game);
diff --git a/src/main.cpp b/src/main.cpp
index f0abb562c..c4295aaa5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -167,10 +167,11 @@ int main(int argc, char *argv[])
if(!CKP.Control.skipstarting)
{
- if(loadStartMenu(&CKP) == 1)
+ while(!loadStartMenu(&CKP))
{
- cleanupResources(&CKP);
- return 0;
+ g_pLogFile->textOut(PURPLE,"Error! You have chosen a Game that doesn't exist. Please correct the \"games.cfg\" File under \"data\" and choose another game.
");
+ //cleanupResources(&CKP);
+ //return 0;
}
}
diff --git a/src/menu.cpp b/src/menu.cpp
index 88f5a3986..a154b44d1 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -144,10 +144,11 @@ short loadResourcesforStartMenu(stCloneKeenPlus *pCKP, CGame *Game)
#define MAINMENU_GOTO_DEMO_TIME 4000
extern char fade_black;
-short loadStartMenu(stCloneKeenPlus *pCKP)
+bool loadStartMenu(stCloneKeenPlus *pCKP)
{
CDialog *GamesMenu;
int i;
+ bool ret;
fade.mode = FADE_GO;
fade.rate = FADE_NORM;
@@ -194,8 +195,14 @@ short loadStartMenu(stCloneKeenPlus *pCKP)
fade.fadetimer = 0;
fade.rate = FADE_NORM;
fade.mode = FADE_GO;
- pCKP->Resources.GameSelected = GamesMenu->getSelection()+1;
- pCKP->Control.levelcontrol.episode = pCKP->GameData[pCKP->Resources.GameSelected-1].Episode;
+
+ if( GamesMenu->getSelection()+1 < pCKP->numGames )
+ {
+ ret = true;
+ pCKP->Resources.GameSelected = GamesMenu->getSelection()+1;
+ pCKP->Control.levelcontrol.episode = pCKP->GameData[pCKP->Resources.GameSelected-1].Episode;
+ }
+ else ret = false;
break;
}
@@ -208,7 +215,7 @@ short loadStartMenu(stCloneKeenPlus *pCKP)
delete GamesMenu;
- return 0;
+ return ret;
}
int mainmenu(stCloneKeenPlus *pCKP,int defaultopt)