diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index d94550930..d7b0b6cb4 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -3736,6 +3736,19 @@ static int parsecommand(void) casecount=0; if (tempscrptr) { + int t,n; + for (i=3;i<3+tempscrptr[1]*2-2;i+=2) // sort them + { + t=tempscrptr[i];n=i; + for (j=i+2;j<3+tempscrptr[1]*2;j+=2) + if (tempscrptr[j] lValue) right=lCheckCase-1; else + if (lpCases[lCheckCase*2] < lValue) left =lCheckCase+1; else + if (lpCases[lCheckCase*2] == lValue) + { + //AddLog("Found Case Match"); + //Bsprintf(g_szBuf,"insptr=%d. lCheckCase=%d, offset=%d, &script[0]=%d", + // (int)insptr,(int)lCheckCase,lpCases[lCheckCase*2+1],(int)&script[0]); + //AddLog(g_szBuf); + // fake a 2-d Array + insptr=(int*)(lpCases[lCheckCase*2+1] + &script[0]); + //Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr); + //AddLog(g_szBuf); + while (1) + { + if (parse()) + break; + } + //AddLog("Done Executing Case"); + bMatched=1; + } + if (right-left<0)break; } if (!bMatched) { diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 04d59e2f5..1f135cd8b 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -233,6 +233,14 @@ int loadsound(unsigned int num) if (num >= MAXSOUNDS || ud.config.SoundToggle == 0) return 0; if (ud.config.FXDevice < 0) return 0; + if (g_sounds[num].filename == NULL) + { +// Bsprintf(fta_quotes[113],"g_sounds %s(#%d) not found.",sounds[num],num); +// FTA(113,g_player[myconnectindex].ps); + OSD_Printf("Sound (#%d) not defined!\n",num); + return 0; + } + fp = kopen4load(g_sounds[num].filename,loadfromgrouponly); if (fp == -1) {