Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Add area monitor callback error checking #64079

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/bullet/area_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ void AreaBullet::call_event(const OverlappingShapeData &p_overlapping_shape, Phy

Variant::CallError outResp;
areaGodoObject->call(event.event_callback_method, (const Variant **)call_event_res_ptr, 5, outResp);

if (outResp.error != Variant::CallError::CALL_OK) {
ERR_PRINT_ONCE("Error calling event callback method " + Variant::get_call_error_text(areaGodoObject, event.event_callback_method, (const Variant **)call_event_res_ptr, 5, outResp));
}
}

int AreaBullet::_overlapping_shape_count(CollisionObjectBullet *p_other_object) {
Expand Down
8 changes: 8 additions & 0 deletions servers/physics/area_sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ void AreaSW::call_queries() {

Variant::CallError ce;
obj->call(monitor_callback_method, (const Variant **)resptr, 5, ce);

if (ce.error != Variant::CallError::CALL_OK) {
ERR_PRINT_ONCE("Error calling monitor callback method " + Variant::get_call_error_text(obj, monitor_callback_method, (const Variant **)resptr, 5, ce));
}
}
} else {
monitored_bodies.clear();
Expand Down Expand Up @@ -264,6 +268,10 @@ void AreaSW::call_queries() {

Variant::CallError ce;
obj->call(area_monitor_callback_method, (const Variant **)resptr, 5, ce);

if (ce.error != Variant::CallError::CALL_OK) {
ERR_PRINT_ONCE("Error calling area monitor callback method " + Variant::get_call_error_text(obj, area_monitor_callback_method, (const Variant **)resptr, 5, ce));
}
}
} else {
monitored_areas.clear();
Expand Down
8 changes: 8 additions & 0 deletions servers/physics_2d/area_2d_sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ void Area2DSW::call_queries() {

Variant::CallError ce;
obj->call(monitor_callback_method, (const Variant **)resptr, 5, ce);

if (ce.error != Variant::CallError::CALL_OK) {
ERR_PRINT_ONCE("Error calling monitor callback method " + Variant::get_call_error_text(obj, monitor_callback_method, (const Variant **)resptr, 5, ce));
}
}
} else {
monitored_bodies.clear();
Expand Down Expand Up @@ -264,6 +268,10 @@ void Area2DSW::call_queries() {

Variant::CallError ce;
obj->call(area_monitor_callback_method, (const Variant **)resptr, 5, ce);

if (ce.error != Variant::CallError::CALL_OK) {
ERR_PRINT_ONCE("Error calling area monitor callback method " + Variant::get_call_error_text(obj, area_monitor_callback_method, (const Variant **)resptr, 5, ce));
}
}
} else {
monitored_areas.clear();
Expand Down