Closed boformer closed 5 years ago
Describe the bug New problem with the master version that I didn't have in 1.2:
static void Postfix(ref ushort segment, NetInfo info, bool __result) { …
throws an error in Harmony
A quick fix is changing bool __result to ref bool __result
bool __result
ref bool __result
Then the patching works!
To Reproduce
Original method:
class NetManager { public bool CreateSegment(out ushort segment, ref Randomizer randomizer, NetInfo info, ushort startNode, ushort endNode, Vector3 startDirection, Vector3 endDirection, uint buildIndex, uint modifiedIndex, bool invert) { … } }
The patch:
[HarmonyPatch(typeof(NetManager), "CreateSegment")] public class NetManagerCreateSegmentPatch { static void Postfix(ref ushort segment, NetInfo info, ref bool __result) { } }
Harmony log and Unity log: https://gist.github.com/boformer/a5eb8b87cc621b03939351d6ad3eb353
Expected behavior It should not throw exceptions!
Runtime environment (please complete the following information):
Fixed in latest master
Describe the bug New problem with the master version that I didn't have in 1.2:
throws an error in Harmony
A quick fix is changing
bool __result
toref bool __result
Then the patching works!
To Reproduce
Original method:
The patch:
Harmony log and Unity log: https://gist.github.com/boformer/a5eb8b87cc621b03939351d6ad3eb353
Expected behavior It should not throw exceptions!
Runtime environment (please complete the following information):