Decompiled source of SprintLadderFix v1.0.0

SprintLadderFix.dll

Decompiled a year 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 SprintLadderFix.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SprintLadderFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SprintLadderFix")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("cd8cad2b-a700-4306-b8a2-1eb833c9d281")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SprintToggleFix
{
	[BepInPlugin("MoonJuice.SprintLadderFix", "SprintLadderFix", "1.0.0")]
	public class SprintLadderFix : BaseUnityPlugin
	{
		private const string modGUID = "MoonJuice.SprintLadderFix";

		private const string modName = "SprintLadderFix";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("MoonJuice.SprintLadderFix");

		private static SprintLadderFix Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("MoonJuice.SprintLadderFix");
			mls.LogInfo((object)"SprintLadderFix loaded");
			harmony.PatchAll(typeof(SprintLadderFix));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
}
namespace SprintLadderFix.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void sprintLadderFix(ref bool ___isClimbingLadder, ref bool ___isSprinting)
		{
			if (___isClimbingLadder)
			{
				___isSprinting = false;
			}
		}
	}
}