Vanilla-Expanded / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
74 stars 37 forks source link

Fix Null MethodInfo/FieldInfo #16

Closed AmCh-Q closed 2 years ago

AmCh-Q commented 2 years ago

Not sure what's the exact cause but I am getting null bodyScaleFactor in PawnRenderer_BaseHeadOffsetAt_Patch.
But changing AccessTools.Method(string fieldColonName) to casting the function to a delegate then grabbing the MethodInfo fixed it for me.
This should also help debugging and (negligibly) improve performance as more checks are done at compile time rather than run time.
Also changed the AccessTools.Field(string fieldColonName) to AccessTools.Field(Type, string Name). This shouldn't have any visible effects at run time.

Taranchuk commented 2 years ago

Looks it was handled in another branch, so I'm closing this