Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

add missing check for disabled physics

hannes1b5fad5aa5d2
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 280a41b4d29..b755ff4296f 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -976,7 +976,17 @@ void SceneTree::set_debug_collisions_hint(bool p_enabled) {
}
bool SceneTree::is_debugging_collisions_hint() const {
- return PhysicsServer2D::get_singleton()->debug_is_enabled() || PhysicsServer3D::get_singleton()->debug_is_enabled();
+#ifndef PHYSICS_2D_DISABLED
+ if (PhysicsServer2D::get_singleton()->debug_is_enabled()) {
+ return true;
+ }
+#endif
+#ifndef PHYSICS_3D_DISABLED
+ if (PhysicsServer3D::get_singleton()->debug_is_enabled()) {
+ return true;
+ }
+#endif
+ return false;
}
void SceneTree::set_debug_paths_hint(bool p_enabled) {