From e5e7c27477b18857e8b07972a8f0b6589e2ffcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sun, 3 Jul 2022 15:30:55 +0800 Subject: fix --- script/vm/runner.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'script') diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 4a26947a..97f362f3 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -270,9 +270,11 @@ function mt:_lookIntoAction(action, topNode) self:_lookIntoExp(value, topNode:copy()) end if action.type == 'setlocal' then - local newTopNode = self._callback(action, topNode) - if newTopNode then - topNode = newTopNode + if action.node == self._loc then + local newTopNode = self._callback(action, topNode) + if newTopNode then + topNode = newTopNode + end end elseif action.type == 'function' then self:_launchBlock(action, topNode:copy()) -- cgit v1.2.3