summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-10-09 14:14:52 +0200
committerGitHub <noreply@github.com>2016-10-09 14:14:52 +0200
commita938319bb7383de920653e2f130238384de84d1c (patch)
tree347703e5a4796d1a972fbf3d1f581cf980823298
parentca732a52dcd5531347ed36809eec26b0ed159703 (diff)
parentf2af5ab9499b343e72269239cb975dd91875bce9 (diff)
Merge pull request #6699 from razvanc-r/fix_variant_can_convert
fixes #6331, Variant::can_convert
-rw-r--r--core/variant.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/variant.cpp b/core/variant.cpp
index a78c07d819..b2afc9d080 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;