Skip to content

Commit 93c3dcb

Browse files
committed
Fix explosion when max_lights is zero
1 parent b19a5d8 commit 93c3dcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/flitter/render/window/canvas3d.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ cdef void collect(Node node, Matrix44 transform_matrix, Material material, Rende
565565
material = material.update(node)
566566
new_render_group = RenderGroup.__new__(RenderGroup)
567567
new_render_group.parent_group = render_group
568-
new_render_group.max_lights = node.get_int('max_lights', DEFAULT_MAX_LIGHTS if render_group is None else render_group.max_lights)
568+
new_render_group.max_lights = max(1, node.get_int('max_lights', DEFAULT_MAX_LIGHTS if render_group is None else render_group.max_lights))
569569
new_render_group.lights = []
570570
new_render_group.instances = {}
571571
new_render_group.depth_sort = node.get_bool('depth_sort', True if render_group is None else render_group.depth_sort)

0 commit comments

Comments
 (0)