Skip to content

Commit

Permalink
samples: core: units may have no transform
Browse files Browse the repository at this point in the history
Part-of: #215
  • Loading branch information
dbartolini committed Dec 20, 2024
1 parent 0b92da3 commit daa2faa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion samples/core/editors/unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ end
function UnitUtils.destroy_tree(world, unit_id)
local function collect_children(scene_graph, unit_id, children)
local transform = SceneGraph.instance(scene_graph, unit_id)
local cur_child = SceneGraph.first_child(scene_graph, transform)
if transform == nil then return end

local cur_child = SceneGraph.first_child(scene_graph, transform)
while cur_child ~= nil do
local child_id = SceneGraph.owner(scene_graph, cur_child)
collect_children(scene_graph, child_id, children)
Expand Down

0 comments on commit daa2faa

Please sign in to comment.