Decompiled source of NoCheatFlag v1.0.0

NoCheatFlag.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NoCheatFlag")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoCheatFlag")]
[assembly: AssemblyTitle("NoCheatFlag")]
[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;
		}
	}
}
[BepInPlugin("zoomheim.nocheatflag", "NoCheatFlag", "1.0.0")]
public class NoCheatFlag : BaseUnityPlugin
{
	[HarmonyPatch(typeof(ItemData), "Load", new Type[]
	{
		typeof(ZPackage),
		typeof(ItemData),
		typeof(Item)
	})]
	private static class ItemDataLoad
	{
		private static void Postfix(ItemData itemData)
		{
			if (itemData != null)
			{
				itemData.m_cheated = false;
			}
		}
	}

	[HarmonyPatch(typeof(Inventory), "Load", new Type[] { typeof(ZPackage) })]
	private static class InventoryLoad
	{
		private static void Postfix(Inventory __instance)
		{
			foreach (ItemData allItem in __instance.GetAllItems())
			{
				allItem.m_cheated = false;
			}
		}
	}

	[HarmonyPatch(typeof(ItemDrop), "OnCreateNew", new Type[]
	{
		typeof(ItemDrop),
		typeof(bool)
	})]
	private static class OnCreateNew
	{
		private static void Prefix(ref bool cheated)
		{
			cheated = false;
		}
	}

	[HarmonyPatch(typeof(ItemData), "GetTooltip", new Type[]
	{
		typeof(ItemData),
		typeof(int),
		typeof(bool),
		typeof(float),
		typeof(int),
		typeof(bool)
	})]
	private static class Tooltip
	{
		private static void Prefix(ItemData item)
		{
			if (item != null)
			{
				item.m_cheated = false;
			}
		}
	}

	private void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("zoomheim.nocheatflag").PatchAll();
	}
}