From a14de5e255c7c29330bf3aca83307806a022a89d Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 4 Jul 2023 17:58:32 +0200 Subject: [PATCH] Fix `Array For Each` visual script node local vars setup --- Source/Engine/Content/Assets/VisualScript.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/Content/Assets/VisualScript.cpp b/Source/Engine/Content/Assets/VisualScript.cpp index b11a2af96..e292a0133 100644 --- a/Source/Engine/Content/Assets/VisualScript.cpp +++ b/Source/Engine/Content/Assets/VisualScript.cpp @@ -618,7 +618,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& // Return case 5: { - auto& scope = ThreadStacks.Get().Stack->Scope; + auto scope = ThreadStacks.Get().Stack->Scope; scope->FunctionReturn = tryGetValue(node->GetBox(1), Value::Zero); break; } @@ -634,7 +634,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& else { // Evaluate method parameter value from the current scope - auto& scope = ThreadStacks.Get().Stack->Scope; + auto scope = ThreadStacks.Get().Stack->Scope; int32 index = boxBase->ID - 1; if (index < scope->Parameters.Length()) value = scope->Parameters.Get()[index]; @@ -1138,7 +1138,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val break; } int32 arrayIndex = 0; - for (; iteratorIndex < scope->ReturnedValues.Count(); arrayIndex++) + for (; arrayIndex < scope->ReturnedValues.Count(); arrayIndex++) { const auto& e = scope->ReturnedValues[arrayIndex]; if (e.NodeId == node->ID && e.BoxId == 1)