Skip to content

Instantly share code, notes, and snippets.

@ghorsington
Created August 30, 2019 21:10
Show Gist options
  • Select an option

  • Save ghorsington/31ed685a89df89ab77cd48be8b446c67 to your computer and use it in GitHub Desktop.

Select an option

Save ghorsington/31ed685a89df89ab77cd48be8b446c67 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Linq;
using Mono.Cecil;
namespace MagicCarrot
{
// Fixes random hangups in Illusion's new game
// Why? I dunno lol
public static class MagicCarrotPatch
{
public static IEnumerable<string> TargetDLLs { get; } =
new[] {"Sirenix.Utilities.dll", "Sirenix.Serialization.dll"};
public static void Patch(AssemblyDefinition ad)
{
var assemblyUtilities = ad.MainModule.Types.FirstOrDefault(t => t.Name == "AssemblyUtilities");
var cctor = assemblyUtilities?.Methods.FirstOrDefault(m => m.Name == ".cctor");
if (cctor == null)
return;
assemblyUtilities.Methods.Remove(cctor);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment