From 0517000e6fd8a325e14d8790dab8b9aa83522c4c Mon Sep 17 00:00:00 2001 From: Nikolai Davydov Date: Sun, 7 Jan 2024 05:30:26 +0100 Subject: [PATCH] Fix virtual calls for GDExtension in `CollisionObject2D` for _mouse_enter, _mouse_exit, _mouse_shape_enter, _mouse_shape_exit --- scene/2d/collision_object_2d.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 2fbe4eb409a..4e5852984b4 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -523,30 +523,22 @@ void CollisionObject2D::_input_event_call(Viewport *p_viewport, const Refcall(SceneStringNames::get_singleton()->_mouse_enter); - } + GDVIRTUAL_CALL(_mouse_enter); emit_signal(SceneStringNames::get_singleton()->mouse_entered); } void CollisionObject2D::_mouse_exit() { - if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_exit); - } + GDVIRTUAL_CALL(_mouse_exit); emit_signal(SceneStringNames::get_singleton()->mouse_exited); } void CollisionObject2D::_mouse_shape_enter(int p_shape) { - if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_enter, p_shape); - } + GDVIRTUAL_CALL(_mouse_shape_enter, p_shape); emit_signal(SceneStringNames::get_singleton()->mouse_shape_entered, p_shape); } void CollisionObject2D::_mouse_shape_exit(int p_shape) { - if (get_script_instance()) { - get_script_instance()->call(SceneStringNames::get_singleton()->_mouse_shape_exit, p_shape); - } + GDVIRTUAL_CALL(_mouse_shape_exit, p_shape); emit_signal(SceneStringNames::get_singleton()->mouse_shape_exited, p_shape); }