summaryrefslogtreecommitdiffstats
path: root/servers/physics_3d/godot_area_3d.h
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-04-27 11:56:39 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-04-27 16:22:57 +0200
commit31e7ee63f21e7b86d41cdb724824d4dc0804f281 (patch)
treecd7146d05bd3ac5069083a1ca499f6662c4971b5 /servers/physics_3d/godot_area_3d.h
parent6118592c6d88350d01f74faff6fd49754f84a7d0 (diff)
downloadredot-engine-31e7ee63f21e7b86d41cdb724824d4dc0804f281.tar.gz
Fix unsafe uses of `Callable.is_null()`
`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and doesn't guarantee the call is valid.
Diffstat (limited to 'servers/physics_3d/godot_area_3d.h')
-rw-r--r--servers/physics_3d/godot_area_3d.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/physics_3d/godot_area_3d.h b/servers/physics_3d/godot_area_3d.h
index c3c9e494a4..701dc73917 100644
--- a/servers/physics_3d/godot_area_3d.h
+++ b/servers/physics_3d/godot_area_3d.h
@@ -107,10 +107,10 @@ class GodotArea3D : public GodotCollisionObject3D {
public:
void set_monitor_callback(const Callable &p_callback);
- _FORCE_INLINE_ bool has_monitor_callback() const { return !monitor_callback.is_null(); }
+ _FORCE_INLINE_ bool has_monitor_callback() const { return monitor_callback.is_valid(); }
void set_area_monitor_callback(const Callable &p_callback);
- _FORCE_INLINE_ bool has_area_monitor_callback() const { return !area_monitor_callback.is_null(); }
+ _FORCE_INLINE_ bool has_area_monitor_callback() const { return area_monitor_callback.is_valid(); }
_FORCE_INLINE_ void add_body_to_query(GodotBody3D *p_body, uint32_t p_body_shape, uint32_t p_area_shape);
_FORCE_INLINE_ void remove_body_from_query(GodotBody3D *p_body, uint32_t p_body_shape, uint32_t p_area_shape);