Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Fieldignore
Browse files Browse the repository at this point in the history
  • Loading branch information
misandrie committed Nov 27, 2023
1 parent 5407998 commit 6d2387d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Marsey/PatchAssemblyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,22 @@ public static void InitAssembly(Assembly assembly, bool subverter = false)
if (MarseyType != null)
{
DataType = MarseyType;

bool ignoreField = false;
List<FieldInfo>? targets = GetPatchAssemblyFields(DataType);
if (targets == null)
FieldInfo? ignoreFieldInfo = DataType.GetField("ignoreFields");

if (ignoreFieldInfo != null)
ignoreField = ignoreFieldInfo.GetValue(null) is bool;

if (ignoreField)
Utility.Log(Utility.LogType.DEBG, $"{assembly.GetName().Name} MarseyPatch is ignoring fields, not assigning");
else if (targets != null && ignoreField != true)
SetAssemblyTargets(targets);
else
{
Utility.Log(Utility.LogType.FATL, $"Couldn't get assembly fields on {assembly.GetName().Name}.");
return;
}
SetAssemblyTargets(targets);
}

// MarseyPatch takes precedence over Subverter, for now
Expand Down

0 comments on commit 6d2387d

Please sign in to comment.