Decompiled source of KeepLvlsOnDeath v1.0.1

KeepLvlsOnDeath.dll

Decompiled 18 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ValheimMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ValheimMod")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("80faf6f3-e49b-4338-922b-9b2eef5decd1")]
[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 KeepLvlsOnDeath;

[BepInPlugin("1nd1g0.KeepLvlsOnDeath", "Keep Levels On Death - by 1nd1g0", "1.0.0")]
[BepInProcess("valheim.exe")]
public class KeepLvlsOnDeath : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Skills), "OnDeath")]
	private class LevelLoss_Patch
	{
		private static void Prefix(ref float ___m_DeathLowerFactor)
		{
			___m_DeathLowerFactor = 0f;
		}
	}

	private readonly Harmony _Harmony = new Harmony("1nd1g0.KeepLvlsOnDeath");

	private void Awake()
	{
		_Harmony.PatchAll();
	}
}