Add Lua method to check whether a scenegraphnode is present in the scene

Make use of the function to guard mark_interesting_nodes against a nonexisting scenegraph node
This commit is contained in:
Alexander Bock
2017-10-24 03:41:02 -07:00
parent 1c2622248c
commit a1b2695765
3 changed files with 22 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
mark_interesting_nodes = function(nodes)
for _, n in pairs(nodes) do
openspace.addTag(n, "GUI.Interesting")
if openspace.hasSceneGraphNode(n) then
openspace.addTag(n, "GUI.Interesting")
end
end
end