summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorsmix8 <52464204+smix8@users.noreply.github.com>2023-11-02 02:19:13 +0100
committersmix8 <52464204+smix8@users.noreply.github.com>2023-11-02 11:23:47 +0100
commit0cba21f2da096d9cc183fecf720fb9f83a9f37ba (patch)
tree0082042bd1a8e9c072d5b3d1c069d9782f19b8f9 /modules
parentda0b1eb128a522bbef083b9f2a5cc2da6917c3d8 (diff)
downloadredot-engine-0cba21f2da096d9cc183fecf720fb9f83a9f37ba.tar.gz
Fix CSGShape debug_collision_shape crash
Fixes CSGShape debug_collision_shape crash.
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_shape.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 0fc61dfe92..9c178997c5 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -488,7 +488,9 @@ bool CSGShape3D::_is_debug_collision_shape_visible() {
}
void CSGShape3D::_update_debug_collision_shape() {
- // NOTE: This is called only for the root shape with collision, when root_collision_shape is valid.
+ if (!use_collision || !is_root_shape() || !root_collision_shape.is_valid() || !_is_debug_collision_shape_visible()) {
+ return;
+ }
ERR_FAIL_NULL(RenderingServer::get_singleton());