Add area monitor callback error checking

This commit is contained in:
Ryan Heath 2022-07-31 19:29:38 -07:00
parent 3976bddaf4
commit 4f5c268a60
3 changed files with 20 additions and 0 deletions

View File

@ -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) {

View File

@ -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();
@ -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();

View File

@ -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();
@ -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();