Skip to content

Commit

Permalink
doktor, turn off my memory inhibitors
Browse files Browse the repository at this point in the history
switch underlying data from bool[] to byte[], add GetRaw versions of public mask access
  • Loading branch information
Priscillalala committed Dec 30, 2023
1 parent 1e869ea commit 96eac97
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 116 deletions.
4 changes: 2 additions & 2 deletions R2API.ProcType.Interop/ProcTypeInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace R2API;

internal static class ProcTypeInterop
{
public static bool[] GetModdedMask(ProcChainMask procChainMask) => procChainMask.r2api_moddedMask;
public static byte[] GetModdedMask(ProcChainMask procChainMask) => procChainMask.r2api_moddedMask;

public static void SetModdedMask(ref ProcChainMask procChainMask, bool[] value) => procChainMask.r2api_moddedMask = value;
public static void SetModdedMask(ref ProcChainMask procChainMask, byte[] value) => procChainMask.r2api_moddedMask = value;
}
Binary file modified R2API.ProcType.Interop/libs/RoR2.Patched.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion R2API.ProcType.Patcher/ProcTypePatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public static IEnumerable<string> TargetDLLs
public static void Patch(AssemblyDefinition assembly)
{
TypeDefinition procChainMask = assembly.MainModule.GetType("RoR2", "ProcChainMask");
procChainMask?.Fields.Add(new FieldDefinition("r2api_moddedMask", FieldAttributes.Public, assembly.MainModule.ImportReference(typeof(bool[]))));
procChainMask?.Fields.Add(new FieldDefinition("r2api_moddedMask", FieldAttributes.Public, assembly.MainModule.ImportReference(typeof(byte[]))));
}
}
Loading

0 comments on commit 96eac97

Please sign in to comment.