summaryrefslogtreecommitdiff
path: root/servers/physics_2d
diff options
context:
space:
mode:
authorRyan Heath <Nosliwnayr@users.noreply.github.com>2022-08-07 13:43:44 -0700
committerRyan Heath <Nosliwnayr@users.noreply.github.com>2022-08-07 13:47:03 -0700
commit9d4e5a466eb3c9b5edcabc8535d1ad6583702070 (patch)
treeeca29b23b61231797e0020a7662a91f99755bcf8 /servers/physics_2d
parent836fe9adcd94e68c30d6042d1ce5bfabde6b3473 (diff)
Add area monitor callback error checking
Diffstat (limited to 'servers/physics_2d')
-rw-r--r--servers/physics_2d/godot_area_2d.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/physics_2d/godot_area_2d.cpp b/servers/physics_2d/godot_area_2d.cpp
index 96c8dfc69e..af90f96438 100644
--- a/servers/physics_2d/godot_area_2d.cpp
+++ b/servers/physics_2d/godot_area_2d.cpp
@@ -248,6 +248,10 @@ void GodotArea2D::call_queries() {
Callable::CallError ce;
Variant ret;
monitor_callback.callp((const Variant **)resptr, 5, ret, ce);
+
+ if (ce.error != Callable::CallError::CALL_OK) {
+ ERR_PRINT_ONCE("Error calling event callback method " + Variant::get_callable_error_text(monitor_callback, (const Variant **)resptr, 5, ce));
+ }
}
} else {
monitored_bodies.clear();
@@ -286,6 +290,10 @@ void GodotArea2D::call_queries() {
Callable::CallError ce;
Variant ret;
area_monitor_callback.callp((const Variant **)resptr, 5, ret, ce);
+
+ if (ce.error != Callable::CallError::CALL_OK) {
+ ERR_PRINT_ONCE("Error calling event callback method " + Variant::get_callable_error_text(area_monitor_callback, (const Variant **)resptr, 5, ce));
+ }
}
} else {
monitored_areas.clear();