Merge pull request #1000 from Faless/ext/variant_can_convert

Fix Variant::can_convert[_strict] returning gibberish.
pull/998/head
Fabio Alessandrelli 2023-01-19 10:16:10 +01:00 committed by GitHub
commit 3d74e661b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -719,14 +719,12 @@ String Variant::get_type_name(Variant::Type type) {
} }
bool Variant::can_convert(Variant::Type from, Variant::Type to) { bool Variant::can_convert(Variant::Type from, Variant::Type to) {
GDExtensionBool can; GDExtensionBool can = internal::gde_interface->variant_can_convert(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
internal::gde_interface->variant_can_convert(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
return PtrToArg<bool>::convert(&can); return PtrToArg<bool>::convert(&can);
} }
bool Variant::can_convert_strict(Variant::Type from, Variant::Type to) { bool Variant::can_convert_strict(Variant::Type from, Variant::Type to) {
GDExtensionBool can; GDExtensionBool can = internal::gde_interface->variant_can_convert_strict(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
internal::gde_interface->variant_can_convert_strict(static_cast<GDExtensionVariantType>(from), static_cast<GDExtensionVariantType>(to));
return PtrToArg<bool>::convert(&can); return PtrToArg<bool>::convert(&can);
} }