From 6fb09f36c74710abd03f9967d60546658e8926f1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 20 Apr 2021 20:41:04 +0200 Subject: [PATCH] - fixed a few parsing errors. --- source/build/src/defs.cpp | 2 ++ source/core/parsefuncs.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 9c480446b..b57986a97 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -342,6 +342,8 @@ static int32_t defsparser(scriptfile *script) break; case T_CUTSCENE: case T_ANIMSOUNDS: + parseEmptyBlockWithParm(*script, pos);; + break; case T_NEWGAMECHOICES: // stub parseEmptyBlock(*script, pos); break; diff --git a/source/core/parsefuncs.h b/source/core/parsefuncs.h index ceb041b29..4bc17b10c 100644 --- a/source/core/parsefuncs.h +++ b/source/core/parsefuncs.h @@ -873,8 +873,20 @@ void parseEmptyBlock(FScanner& sc, FScriptPosition& pos) if (sc.StartBraces(&blockend)) return; sc.RestorePos(blockend); + sc.CheckString("}"); } +void parseEmptyBlockWithParm(FScanner& sc, FScriptPosition& pos) +{ + FScanner::SavedPos blockend; + + sc.MustGetString(); + if (sc.StartBraces(&blockend)) return; + sc.RestorePos(blockend); + sc.CheckString("}"); +} + + //=========================================================================== // // @@ -978,6 +990,7 @@ static void parseBlendTableGlBlend(FScanner& sc, FScriptPosition& pos, int id) { int whichb = 0; sc.MustGetString(); + if (sc.Compare("}")) break; if (sc.Compare({ "src", "sfactor", "top" })) whichb = 0; else if (sc.Compare({ "dst", "dfactor", "bottom" })) whichb = 1; else if (sc.Compare("alpha")) @@ -987,6 +1000,7 @@ static void parseBlendTableGlBlend(FScanner& sc, FScriptPosition& pos, int id) continue; } uint8_t* const factor = whichb == 0 ? &bdef.src : &bdef.dst; + sc.MustGetString(); if (sc.Compare("ZERO")) *factor = STYLEALPHA_Zero; else if (sc.Compare("ONE")) *factor = STYLEALPHA_One; else if (sc.Compare("SRC_COLOR")) *factor = STYLEALPHA_SrcCol;