Merge pull request #6699 from razvanc-r/fix_variant_can_convert

fixes #6331, Variant::can_convert
This commit is contained in:
Rémi Verschelde 2016-10-09 14:14:52 +02:00 committed by GitHub
commit a938319bb7

View file

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