Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSharpScript should not own method infos of the base class #91564

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions modules/mono/csharp_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,14 +1596,7 @@ void CSharpInstance::get_method_list(List<MethodInfo> *p_list) const {
return;
}

const CSharpScript *top = script.ptr();
while (top != nullptr) {
for (const CSharpScript::CSharpMethodInfo &E : top->methods) {
p_list->push_back(E.method_info);
}

top = top->base_script.ptr();
}
script->get_script_method_list(p_list);
}

bool CSharpInstance::has_method(const StringName &p_method) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ static void AppendTypeName(StringBuilder sb, Type type)
using var methods = new Collections.Array();

Type? top = scriptType;
raulsntos marked this conversation as resolved.
Show resolved Hide resolved
Type native = GodotObject.InternalGetClassNativeBase(top);
Type native = GodotObject.InternalGetClassNativeBase(scriptType);

while (top != null && top != native)
if (scriptType != null && scriptType != native)
raulsntos marked this conversation as resolved.
Show resolved Hide resolved
{
var methodList = GetMethodListForType(top);
var methodList = GetMethodListForType(scriptType);

if (methodList != null)
{
Expand Down Expand Up @@ -859,8 +859,6 @@ static void AppendTypeName(StringBuilder sb, Type type)
methods.Add(methodInfo);
}
}

top = top.BaseType;
}

*outMethodsDest = NativeFuncs.godotsharp_array_new_copy(
Expand Down