From 008056763ae5ab33f3028e881d99279613972400 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:22:55 +0000 Subject: [PATCH] Tweak gamevar struct shortcut error handling git-svn-id: https://svn.eduke32.com/eduke32@7035 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 8db4fd661..78b88a1a1 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -1866,8 +1866,6 @@ static void C_GetNextVarType(int32_t type) C_SkipComments(); //skip comments and whitespace if (*textptr == '[') //read of array as a gamevar { - int32_t labelNum = -1; - f |= (MAXGAMEVARS<<2); textptr++; i=GetADefID(label+(g_labelCnt<<6)); @@ -1959,6 +1957,8 @@ static void C_GetNextVarType(int32_t type) C_GetNextLabelName(); /*initprintf("found xxx label of \"%s\"\n", label+(g_numLabels<<6));*/ + int32_t labelNum = -1; + switch (i - g_structVarIDs) { case STRUCT_SPRITE: @@ -1996,10 +1996,7 @@ static void C_GetNextVarType(int32_t type) case STRUCT_PALDATA: labelNum=C_GetLabelNameOffset(&h_paldata,Bstrtolower(label+(g_labelCnt<<6))); break; - } - - if (EDUKE32_PREDICT_FALSE(labelNum == -1)) - { + default: g_errorCnt++; C_ReportError(ERROR_NOTAMEMBER); return;