From be69d264033178fa0ec47d46a0ce4a89b18b6506 Mon Sep 17 00:00:00 2001 From: LATRio Date: Sat, 2 Oct 2021 21:45:01 +0900 Subject: [PATCH] Fix crash at SoftBodyBullet::reset_all_node_positions when bt_soft_body isn't initialized Update soft_body_bullet.cpp --- modules/bullet/soft_body_bullet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/bullet/soft_body_bullet.cpp b/modules/bullet/soft_body_bullet.cpp index cf7af595047..5c71d3b3ebd 100644 --- a/modules/bullet/soft_body_bullet.cpp +++ b/modules/bullet/soft_body_bullet.cpp @@ -228,7 +228,7 @@ void SoftBodyBullet::reset_all_node_mass() { } void SoftBodyBullet::reset_all_node_positions() { - if (soft_mesh.is_null()) { + if (soft_mesh.is_null() || !bt_soft_body) { return; } @@ -246,6 +246,10 @@ void SoftBodyBullet::reset_all_node_positions() { } void SoftBodyBullet::set_activation_state(bool p_active) { + if (!bt_soft_body) { + return; + } + if (p_active) { bt_soft_body->setActivationState(ACTIVE_TAG); } else {