Decompiled source of InfiniteSprint v1.0.1

plugin/InfiniteSprint.dll

Decompiled 9 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
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: AssemblyTitle("InfiniteSprint")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InfiniteSprint")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("de99e52d-3263-4c46-ac38-44ee6ee53767")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InfiniteSprint
{
	[BepInPlugin("CopyCat666.InfiniteSprint", "Infinite Sprint", "1.0.1")]
	public class InfiniteSprintBase : BaseUnityPlugin
	{
		private const string modGUID = "CopyCat666.InfiniteSprint";

		private const string modName = "Infinite Sprint";

		private const string modVersion = "1.0.1";

		private readonly Harmony harmony = new Harmony("CopyCat666.InfiniteSprint");

		private static InfiniteSprintBase instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = ((BaseUnityPlugin)this).Logger;
			mls.LogInfo((object)"NaNSprint active!");
			harmony.PatchAll();
		}
	}
}
namespace InfiniteSprint.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(PlayerControllerB __instance)
		{
			if (__instance.isSprinting && !__instance.isInsideFactory)
			{
				__instance.sprintMeter = 1f;
			}
		}
	}
}