Decompiled source of LethalMinV81Fix v1.0.0

plugins/LethalMinV81Fix.dll

Decompiled 2 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LethalMinV81Fix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalMinV81Fix")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ee078905-6fed-4ed9-9e0d-4eb72c6ee08b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalMinV81Fix
{
	[BepInPlugin("Taylor.LethalMinV81Fix", "LethalMin V81 Fix", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private Harmony _harmony;

		private void Awake()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			_harmony = new Harmony("Taylor.LethalMinV81Fix");
			_harmony.PatchAll();
			Log.LogInfo((object)"LethalMin V81 Fix loaded.");
		}
	}
	[HarmonyPatch(typeof(ShotgunItem), "ShootGun")]
	internal static class ShotgunPatch
	{
		private static readonly FieldInfo EnemyCollidersField = AccessTools.Field(typeof(ShotgunItem), "enemyColliders");

		[HarmonyPrefix]
		private static void Prefix(ShotgunItem __instance)
		{
			if (EnemyCollidersField == null)
			{
				Plugin.Log.LogError((object)"LethalMin V81 Fix: Could not find ShotgunItem.enemyColliders field.");
			}
			else if (!(EnemyCollidersField.GetValue(__instance) is RaycastHit[] array) || array.Length < 120)
			{
				EnemyCollidersField.SetValue(__instance, new RaycastHit[120]);
			}
		}
	}
}