Decompiled source of Tames Follow v1.0.1

TamesFollow.dll

Decompiled 4 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using JetBrains.Annotations;
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(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("TamesFollow")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TamesFollow")]
[assembly: AssemblyTitle("TamesFollow")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TamesFollow;

[BepInPlugin("oldmankatan.mods.tamesfollow", "Tames Follow", "1.0.0")]
public class TamesFollow : BaseUnityPlugin
{
	public const string PluginId = "oldmankatan.mods.tamesfollow";

	private static TamesFollow _instance;

	private Harmony _harmony;

	[UsedImplicitly]
	private void Awake()
	{
		_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "oldmankatan.mods.tamesfollow");
		_instance = this;
	}

	[UsedImplicitly]
	private void OnDestroy()
	{
		Harmony harmony = _harmony;
		if (harmony != null)
		{
			harmony.UnpatchSelf();
		}
		_instance = null;
	}
}
[HarmonyPatch(typeof(Tameable), "Interact")]
public class Tameable_Interact_Patch
{
	private static void Prefix(Tameable __instance)
	{
		Character component = ((Component)__instance).GetComponent<Character>();
		if (component.IsTamed())
		{
			__instance.m_commandable = true;
		}
	}
}