diff options
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 2369e84f..46c32f3a 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -293,10 +293,19 @@ 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 + if obj._root then + source._root = obj._root + return source._root + end local parent = obj.parent if not parent then return nil |