C# Fix deserialization of delegates that are 0-parameter overloads
Co-authored-by: Raul Santos <raulsntos@gmail.com>
(cherry picked from commit 783facf60b
)
This commit is contained in:
parent
c6c5b5bf78
commit
88f5f815e6
|
@ -500,10 +500,7 @@ namespace Godot
|
||||||
Type? returnType = hasReturn ? DeserializeType(reader) : typeof(void);
|
Type? returnType = hasReturn ? DeserializeType(reader) : typeof(void);
|
||||||
|
|
||||||
int parametersCount = reader.ReadInt32();
|
int parametersCount = reader.ReadInt32();
|
||||||
|
var parameterTypes = parametersCount == 0 ? Type.EmptyTypes : new Type[parametersCount];
|
||||||
if (parametersCount > 0)
|
|
||||||
{
|
|
||||||
var parameterTypes = new Type[parametersCount];
|
|
||||||
|
|
||||||
for (int i = 0; i < parametersCount; i++)
|
for (int i = 0; i < parametersCount; i++)
|
||||||
{
|
{
|
||||||
|
@ -517,10 +514,6 @@ namespace Godot
|
||||||
return methodInfo != null && methodInfo.ReturnType == returnType;
|
return methodInfo != null && methodInfo.ReturnType == returnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
methodInfo = declaringType.GetMethod(methodName, (BindingFlags)flags);
|
|
||||||
return methodInfo != null && methodInfo.ReturnType == returnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Type? DeserializeType(BinaryReader reader)
|
private static Type? DeserializeType(BinaryReader reader)
|
||||||
{
|
{
|
||||||
int genericArgumentsCount = reader.ReadInt32();
|
int genericArgumentsCount = reader.ReadInt32();
|
||||||
|
|
Loading…
Reference in New Issue