From cc855e065aea3b2d4f16087baf2abcee7fec44d6 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 26 Feb 2019 16:58:16 +0300 Subject: [PATCH 1/3] Ignore stray references for variables in Set instruction --- components/compiler/lineparser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 3f9d2e790..1cfa70f73 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -506,6 +506,13 @@ namespace Compiler return true; } + if (code==Scanner::S_ref && mState==SetPotentialMemberVarState) + { + getErrorHandler().warning ("Ignoring stray explicit reference", loc); + mState = SetState; + return true; + } + if (code==Scanner::S_ref && mState==PotentialExplicitState) { mState = ExplicitState; From 9bc360267bb89352ee26de9f2c27d7fc6122fd0a Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 26 Feb 2019 17:22:57 +0300 Subject: [PATCH 2/3] Ignore stray explicit references for names in expressions --- components/compiler/exprparser.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/compiler/exprparser.cpp b/components/compiler/exprparser.cpp index 6b849ec3a..b3fd1e5ae 100644 --- a/components/compiler/exprparser.cpp +++ b/components/compiler/exprparser.cpp @@ -277,10 +277,18 @@ namespace Compiler { if (!mExplicit.empty()) { - if (mMemberOp && handleMemberAccess (name)) - return true; + if (!mRefOp) + { + if (mMemberOp && handleMemberAccess (name)) + return true; - return Parser::parseName (name, loc, scanner); + return Parser::parseName (name, loc, scanner); + } + else + { + mExplicit.clear(); + getErrorHandler().warning ("Ignoring stray explicit reference", loc); + } } mFirst = false; From e940325b7869a3f7209b9c72b5d1987037c0a255 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 26 Feb 2019 19:13:46 +0300 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fa1c7683..fac0b4ac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Bug #4837: CTD when a mesh with NiLODNode root node with particles is loaded Bug #4860: Actors outside of processing range visible for one frame after spawning Bug #4876: AI ratings handling inconsistencies + Bug #4888: Global variable stray explicit reference calls break script compilation Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis