Skip to content

Commit

Permalink
Replace stuff need not worry about DefOfHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
alextd committed Feb 27, 2020
1 parent d54c369 commit 91c1845
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions Source/Replace_Stuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,7 @@ public Mod(ModContentPack content) : base(content)
#if DEBUG
Harmony.DEBUG = true;
#endif

Harmony harmony = new Harmony("Uuugggg.rimworld.Replace_Stuff.main");

//Turn off DefOf warning since harmony patches trigger it.
MethodInfo DefOfHelperInfo = AccessTools.Method(typeof(DefOfHelper), "EnsureInitializedInCtor");
if (!harmony.GetPatchedMethods().Contains(DefOfHelperInfo))
harmony.Patch(DefOfHelperInfo, new HarmonyMethod(typeof(Mod), "EnsureInitializedInCtorPrefix"), null);

harmony.PatchAll();
}

public static bool EnsureInitializedInCtorPrefix()
{
//No need to display this warning.
return false;
new Harmony("Uuugggg.rimworld.Replace_Stuff.main").PatchAll();
}

[StaticConstructorOnStartup]
Expand Down

0 comments on commit 91c1845

Please sign in to comment.