summaryrefslogtreecommitdiff
path: root/script/core/guide.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/guide.lua')
-rw-r--r--script/core/guide.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/core/guide.lua b/script/core/guide.lua
index b80a3628..64192297 100644
--- a/script/core/guide.lua
+++ b/script/core/guide.lua
@@ -290,8 +290,13 @@ end
---@param obj parser.guide.object
---@return parser.guide.object
function m.getRoot(obj)
+ local source = obj
+ if source._root then
+ return source._root
+ end
for _ = 1, 1000 do
if obj.type == 'main' then
+ source._root = obj
return obj
end
local parent = obj.parent