mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
interrogate: Fix bug sorting overloads of AsyncFuture::set_result()
This commit is contained in:
parent
89a1c8bff7
commit
eab1308438
@ -4283,18 +4283,19 @@ int get_type_sort(CPPType *type) {
|
|||||||
TypeManager::is_struct(type)) {
|
TypeManager::is_struct(type)) {
|
||||||
answer = 20;
|
answer = 20;
|
||||||
int deepest = 0;
|
int deepest = 0;
|
||||||
TypeIndex type_index = builder.get_type(TypeManager::unwrap(TypeManager::resolve_type(type)), false);
|
|
||||||
InterrogateDatabase *idb = InterrogateDatabase::get_ptr();
|
|
||||||
const InterrogateType &itype = idb->get_type(type_index);
|
|
||||||
|
|
||||||
if (itype.is_class() || itype.is_struct()) {
|
// Sort such that more derived classes come first.
|
||||||
int num_derivations = itype.number_of_derivations();
|
type = TypeManager::unwrap(TypeManager::resolve_type(type));
|
||||||
for (int di = 0; di < num_derivations; di++) {
|
if (type != nullptr) {
|
||||||
TypeIndex d_type_Index = itype.get_derivation(di);
|
CPPStructType *struct_type = type->as_struct_type();
|
||||||
const InterrogateType &d_itype = idb->get_type(d_type_Index);
|
if (struct_type != nullptr) {
|
||||||
int this_one = get_type_sort(d_itype._cpptype);
|
for (const CPPStructType::Base &base : struct_type->_derivation) {
|
||||||
if (this_one > deepest) {
|
if (base._base != nullptr) {
|
||||||
deepest = this_one;
|
int this_one = get_type_sort(base._base);
|
||||||
|
if (this_one > deepest) {
|
||||||
|
deepest = this_one;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user