Throw a warning when attempting to use CON_DEFINESOUND with a sound index that has already been defined

git-svn-id: https://svn.eduke32.com/eduke32@7810 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-07-19 01:49:37 +00:00 committed by Christoph Oelckers
parent 67dc0cb5f8
commit 763b4b8d7f

View file

@ -5646,6 +5646,12 @@ repeatcase:
g_errorCnt++; g_errorCnt++;
k = MAXSOUNDS-1; k = MAXSOUNDS-1;
} }
else if (EDUKE32_PREDICT_FALSE(g_sounds[k].filename != NULL))
{
initprintf("%s:%d: warning: sound %d already defined (%s)\n",g_scriptFileName,g_lineNumber,k,g_sounds[k].filename);
g_warningCnt++;
}
g_scriptPtr--; g_scriptPtr--;
i = 0; i = 0;
C_SkipComments(); C_SkipComments();