diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 10:39:08 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 10:39:08 +0100 |
commit | 40258bbbe89b0372700e056e8c8af07b0fd2179f (patch) | |
tree | 8da5936f5ddf118e8dbb55d277122f2cc9c5e4c9 /scene | |
parent | d831ba1d6f32088abae0de00962f502ff93a0760 (diff) | |
parent | 86fa3ba56015b0fb6f282277b37c211fe803c6f9 (diff) |
Merge pull request #67577 from qarmin/fix_exporting_big_templates
Fix exporting with big export templates
Diffstat (limited to 'scene')
-rw-r--r-- | scene/property_utils.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/scene/property_utils.cpp b/scene/property_utils.cpp index a9b7e9acbe..f445634a45 100644 --- a/scene/property_utils.cpp +++ b/scene/property_utils.cpp @@ -169,8 +169,10 @@ static bool _collect_inheritance_chain(const Ref<SceneState> &p_state, const Nod state = state->get_base_scene_state(); } - for (int i = inheritance_states.size() - 1; i >= 0; --i) { - r_states_stack.push_back(inheritance_states[i]); + if (inheritance_states.size() > 0) { + for (int i = inheritance_states.size() - 1; i >= 0; --i) { + r_states_stack.push_back(inheritance_states[i]); + } } return found; @@ -214,10 +216,12 @@ Vector<SceneState::PackState> PropertyUtils::get_node_states_stack(const Node *p { states_stack_ret.resize(states_stack.size()); _FastPackState *ps = states_stack.ptr(); - for (int i = states_stack.size() - 1; i >= 0; --i) { - states_stack_ret.write[i].state.reference_ptr(ps->state); - states_stack_ret.write[i].node = ps->node; - ++ps; + if (states_stack.size() > 0) { + for (int i = states_stack.size() - 1; i >= 0; --i) { + states_stack_ret.write[i].state.reference_ptr(ps->state); + states_stack_ret.write[i].node = ps->node; + ++ps; + } } } return states_stack_ret; |