Decompiled source of DuplicateUpgradesAllowed v0.5.2

DuplicateUpgradesAllowed.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using DuplicateUpgradesAllowed.Patches;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("DuplicateUpgradesAllowed")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DuplicateUpgradesAllowed")]
[assembly: AssemblyTitle("DuplicateUpgradesAllowed")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DuplicateUpgradesAllowed
{
	[BepInPlugin("Poseidon.SampleMycoMod", "SampleMycoMod", "1.0.0")]
	public class Patch : BaseUnityPlugin
	{
		private const string ModGuid = "Poseidon.SampleMycoMod";

		private const string ModName = "SampleMycoMod";

		private const string ModVersion = "1.0.0";

		private readonly Harmony _harmony = new Harmony("Poseidon.SampleMycoMod");

		private ManualLogSource _mls;

		private void Awake()
		{
			_mls = Logger.CreateLogSource("Poseidon.SampleMycoMod");
			Debug.Log((object)"SampleMycoMod, 1.0.0 Active");
			_mls.LogMessage((object)"SampleMycoMod, 1.0.0 Active");
			try
			{
				_harmony.PatchAll(typeof(StackableUpgradesPatch));
			}
			catch (Exception ex)
			{
				Debug.Log((object)ex);
			}
		}
	}
}
namespace DuplicateUpgradesAllowed.Patches
{
	[HarmonyPatch(typeof(ModuleEquipSlots))]
	public class StackableUpgradesPatch
	{
		private static HexMap tempHex;

		[HarmonyPatch("CancelStackingEquip")]
		[HarmonyPrefix]
		public static void CancelStackingEquipPatchPre(ref HexMap ___hexMap)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			tempHex = ___hexMap;
			___hexMap = new HexMap();
		}

		[HarmonyPatch("CancelStackingEquip")]
		[HarmonyPostfix]
		public static void CancelStackingEquipPatchPost(ref HexMap ___hexMap)
		{
			___hexMap = tempHex;
		}
	}
}