diff --git a/include/godot_cpp/core/object.hpp b/include/godot_cpp/core/object.hpp index a2fa96e7..f5c790aa 100644 --- a/include/godot_cpp/core/object.hpp +++ b/include/godot_cpp/core/object.hpp @@ -142,7 +142,7 @@ T *Object::cast_to(Object *p_object) { if (casted == nullptr) { return nullptr; } - return dynamic_cast((Object *)internal::gde_interface->object_get_instance_binding(casted, internal::token, &T::___binding_callbacks)); + return reinterpret_cast(internal::gde_interface->object_get_instance_binding(casted, internal::token, &T::___binding_callbacks)); } template @@ -155,7 +155,7 @@ const T *Object::cast_to(const Object *p_object) { if (casted == nullptr) { return nullptr; } - return dynamic_cast((Object *)internal::gde_interface->object_get_instance_binding(casted, internal::token, &T::___binding_callbacks)); + return reinterpret_cast(internal::gde_interface->object_get_instance_binding(casted, internal::token, &T::___binding_callbacks)); } } // namespace godot