From 97cc8aed187605c07320b669c257e42bd3906399 Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Sat, 15 Mar 2025 17:17:57 +0900 Subject: [PATCH] Add is_inside_tree() check to SpringBoneSimulator3D --- scene/3d/spring_bone_simulator_3d.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scene/3d/spring_bone_simulator_3d.cpp b/scene/3d/spring_bone_simulator_3d.cpp index 3248cd5893..abbb8732f0 100644 --- a/scene/3d/spring_bone_simulator_3d.cpp +++ b/scene/3d/spring_bone_simulator_3d.cpp @@ -1344,6 +1344,9 @@ void SpringBoneSimulator3D::_find_collisions() { } void SpringBoneSimulator3D::_process_collisions() { + if (!is_inside_tree()) { + return; + } for (const ObjectID &oid : collisions) { Object *t_obj = ObjectDB::get_instance(oid); if (!t_obj) { @@ -1467,6 +1470,10 @@ void SpringBoneSimulator3D::_set_active(bool p_active) { } void SpringBoneSimulator3D::_process_modification() { + if (!is_inside_tree()) { + return; + } + Skeleton3D *skeleton = get_skeleton(); if (!skeleton) { return; @@ -1488,6 +1495,9 @@ void SpringBoneSimulator3D::_process_modification() { } void SpringBoneSimulator3D::reset() { + if (!is_inside_tree()) { + return; + } Skeleton3D *skeleton = get_skeleton(); if (!skeleton) { return;