Decompiled source of AllowFireOnWood v1.0.0

AllowFireOnWood.dll

Decompiled 4 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
[assembly: AssemblyCompany("AllowFireOnWood")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Allow placing fire on wood")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AllowFireOnWood")]
[assembly: AssemblyTitle("AllowFireOnWood")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 AllowFireOnWood
{
	[BepInPlugin("AllowFireOnWood", "AllowFireOnWood", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony harmony;

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

		[HarmonyPatch(typeof(PieceTable), "GetSelectedPiece")]
		[HarmonyPostfix]
		private static void GetSelectedPieceSuffix(ref Piece __result)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and I4
			if (!((Object)(object)__result == (Object)null) && __result.m_notOnWood && (int)__result.m_comfortGroup == 1)
			{
				__result.m_notOnWood = false;
			}
		}
	}
	internal class PluginInfo
	{
		public const string PLUGIN_GUID = "AllowFireOnWood";

		public const string PLUGIN_NAME = "AllowFireOnWood";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "AllowFireOnWood";

		public const string PLUGIN_NAME = "AllowFireOnWood";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}