Fix crash in GIProbe::bake
The problem happened when the passed from_node was null and the GIProbe
node had no parent node.
Fixes #45978
(cherry picked from commit 82fed7b6da
)
This commit is contained in:
parent
05367c755c
commit
279b9f43f3
1 changed files with 4 additions and 1 deletions
|
@ -399,13 +399,16 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) {
|
|||
|
||||
static const int subdiv_value[SUBDIV_MAX] = { 7, 8, 9, 10 };
|
||||
|
||||
p_from_node = p_from_node ? p_from_node : get_parent();
|
||||
ERR_FAIL_NULL(p_from_node);
|
||||
|
||||
VoxelLightBaker baker;
|
||||
|
||||
baker.begin_bake(subdiv_value[subdiv], AABB(-extents, extents * 2.0));
|
||||
|
||||
List<PlotMesh> mesh_list;
|
||||
|
||||
_find_meshes(p_from_node ? p_from_node : get_parent(), mesh_list);
|
||||
_find_meshes(p_from_node, mesh_list);
|
||||
|
||||
if (bake_begin_function) {
|
||||
bake_begin_function(mesh_list.size() + 1);
|
||||
|
|
Loading…
Reference in a new issue