Tweak gamevar struct shortcut error handling

git-svn-id: https://svn.eduke32.com/eduke32@7035 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-07 05:22:55 +00:00
parent 3d9df928a5
commit 008056763a

View file

@ -1866,8 +1866,6 @@ static void C_GetNextVarType(int32_t type)
C_SkipComments(); //skip comments and whitespace C_SkipComments(); //skip comments and whitespace
if (*textptr == '[') //read of array as a gamevar if (*textptr == '[') //read of array as a gamevar
{ {
int32_t labelNum = -1;
f |= (MAXGAMEVARS<<2); f |= (MAXGAMEVARS<<2);
textptr++; textptr++;
i=GetADefID(label+(g_labelCnt<<6)); i=GetADefID(label+(g_labelCnt<<6));
@ -1959,6 +1957,8 @@ static void C_GetNextVarType(int32_t type)
C_GetNextLabelName(); C_GetNextLabelName();
/*initprintf("found xxx label of \"%s\"\n", label+(g_numLabels<<6));*/ /*initprintf("found xxx label of \"%s\"\n", label+(g_numLabels<<6));*/
int32_t labelNum = -1;
switch (i - g_structVarIDs) switch (i - g_structVarIDs)
{ {
case STRUCT_SPRITE: case STRUCT_SPRITE:
@ -1996,10 +1996,7 @@ static void C_GetNextVarType(int32_t type)
case STRUCT_PALDATA: case STRUCT_PALDATA:
labelNum=C_GetLabelNameOffset(&h_paldata,Bstrtolower(label+(g_labelCnt<<6))); labelNum=C_GetLabelNameOffset(&h_paldata,Bstrtolower(label+(g_labelCnt<<6)));
break; break;
} default:
if (EDUKE32_PREDICT_FALSE(labelNum == -1))
{
g_errorCnt++; g_errorCnt++;
C_ReportError(ERROR_NOTAMEMBER); C_ReportError(ERROR_NOTAMEMBER);
return; return;