mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-27 12:35:28 +00:00
weaver: apply generic arguments as you climb up the base types
This commit is contained in:
parent
e54892367f
commit
156ff291e3
@ -3,9 +3,9 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
|
||||
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" />
|
||||
<PackageReference Include="OWML" Version="2.3.2" />
|
||||
<PackageReference Include="HarmonyX" Version="2.9.0" />
|
||||
<Reference Include="../Mirror/*.dll" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -52,9 +52,11 @@ public static class QSBReaderWriterProcessor
|
||||
{
|
||||
var argType = calledMethod.GenericArguments[0];
|
||||
|
||||
if (argType is GenericParameter genericParameter && genericParameter.Owner == currentTypeDef)
|
||||
if (currentType is GenericInstanceType genericInstanceType &&
|
||||
argType is GenericParameter genericParameter &&
|
||||
genericParameter.Owner == currentTypeDef)
|
||||
{
|
||||
argType = ((GenericInstanceType)currentType).GenericArguments[genericParameter.Position];
|
||||
argType = genericInstanceType.GenericArguments[genericParameter.Position];
|
||||
}
|
||||
|
||||
writers.GetWriteFunc(argType, ref weavingFailed);
|
||||
@ -65,9 +67,11 @@ public static class QSBReaderWriterProcessor
|
||||
{
|
||||
var argType = calledMethod.GenericArguments[0];
|
||||
|
||||
if (argType is GenericParameter genericParameter && genericParameter.Owner == currentTypeDef)
|
||||
if (currentType is GenericInstanceType genericInstanceType &&
|
||||
argType is GenericParameter genericParameter &&
|
||||
genericParameter.Owner == currentTypeDef)
|
||||
{
|
||||
argType = ((GenericInstanceType)currentType).GenericArguments[genericParameter.Position];
|
||||
argType = genericInstanceType.GenericArguments[genericParameter.Position];
|
||||
}
|
||||
|
||||
readers.GetReadFunc(argType, ref weavingFailed);
|
||||
@ -76,7 +80,7 @@ public static class QSBReaderWriterProcessor
|
||||
}
|
||||
}
|
||||
|
||||
currentType = currentTypeDef.BaseType;
|
||||
currentType = currentTypeDef.BaseType?.ApplyGenericParameters(currentType);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user