You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
fixes #6331, Variant::can_convert
(cherry picked from commit f2af5ab949)
This commit is contained in:
committed by
Rémi Verschelde
parent
342b1408d5
commit
97ebfddaaf
@@ -429,6 +429,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) {
|
|||||||
return true;
|
return true;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (invalid_types) {
|
} else if (invalid_types) {
|
||||||
|
|
||||||
|
|
||||||
@@ -439,6 +440,8 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) {
|
|||||||
return false;
|
return false;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
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 *valid_types=NULL;
|
||||||
const Type *invalid_types=NULL;
|
|
||||||
|
|
||||||
switch(p_type_to) {
|
switch(p_type_to) {
|
||||||
case BOOL: {
|
case BOOL: {
|
||||||
@@ -679,16 +681,6 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_
|
|||||||
return true;
|
return true;
|
||||||
i++;
|
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;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user