From 97ebfddaafc64e14e815934bbb7ca6363314063c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=83zvan=20Cosmin=20R=C4=83dulescu?= Date: Tue, 4 Oct 2016 12:36:31 +0200 Subject: [PATCH] fixes #6331, Variant::can_convert (cherry picked from commit f2af5ab9499b343e72269239cb975dd91875bce9) --- core/variant.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/variant.cpp b/core/variant.cpp index a78c07d819e..b2afc9d080b 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -429,6 +429,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { return true; i++; } + } else if (invalid_types) { @@ -439,6 +440,8 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { return false; i++; } + + return true; } return false; @@ -457,7 +460,6 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; const Type *valid_types=NULL; - const Type *invalid_types=NULL; switch(p_type_to) { case BOOL: { @@ -679,16 +681,6 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ return true; i++; } - } else if (invalid_types) { - - - int i=0; - while(invalid_types[i]!=NIL) { - - if (p_type_from==invalid_types[i]) - return false; - i++; - } } return false;