Decompiled source of ToneHeim Client Mods v1.0.7

plugins/RemoveRaidIcon.dll

Decompiled a year ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RemoveRaidIcon")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RemoveRaidIcon")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("67f40cdf-9038-4a7d-b7a1-fdc9567f1a85")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RemoveRaidIcon;

[BepInPlugin("removeraidicon", "Remove Raid Icon", "1.2.0")]
[BepInProcess("valheim.exe")]
public class RemoveRaidPin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Minimap), "UpdateEventPin")]
	private class Minimap_UpdateEventPin_Patch
	{
		private static void Postfix(Minimap __instance, ref PinData ___m_randEventAreaPin, ref PinData ___m_randEventPin)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			if (___m_randEventAreaPin != null && (int)___m_randEventAreaPin.m_type == 13)
			{
				__instance.RemovePin(___m_randEventAreaPin);
				__instance.RemovePin(___m_randEventPin);
			}
		}
	}

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("removeraidicond");
		val.PatchAll();
	}
}