Decompiled source of DK FixInvisiblePlayers v1.0.0

DK_FixInvisiblePlayers.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using DK_LethalMod.Patches;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
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("DK_LethalMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DK_LethalMod")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a0bf24d0-862f-4bc6-87d7-9452a7f63997")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 DK_LethalMod
{
	[BepInPlugin("DarklordKnaag.FixInvisiblePlayers", "DK Fix Invisible Players", "1.0.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "DarklordKnaag.FixInvisiblePlayers";

		private const string modName = "DK Fix Invisible Players";

		private const string modVersion = "1.0.0.0";

		public static Plugin instance;

		private readonly Harmony harmony = new Harmony("DarklordKnaag.FixInvisiblePlayers");

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			Variables.mls = Logger.CreateLogSource("DarklordKnaag.FixInvisiblePlayers");
			harmony.PatchAll(typeof(Plugin));
			harmony.PatchAll(typeof(OnPlayerDC_Patch));
			Variables.mls.LogInfo((object)"Base Awake :)");
		}
	}
	public static class Variables
	{
		public static ManualLogSource mls;
	}
}
namespace DK_LethalMod.Patches
{
	[HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")]
	[HarmonyWrapSafe]
	internal static class OnPlayerDC_Patch
	{
		[HarmonyPostfix]
		private static void Postfix(int playerObjectNumber)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObjectNumber];
			val.activatingItem = false;
			val.bleedingHeavily = false;
			val.clampLooking = false;
			val.criticallyInjured = false;
			val.Crouch(false);
			val.disableInteract = false;
			val.DisableJetpackControlsLocally();
			val.disableLookInput = false;
			val.disableMoveInput = false;
			val.DisablePlayerModel(((Component)val).gameObject, true, true);
			val.disableSyncInAnimation = false;
			val.externalForceAutoFade = Vector3.zero;
			val.freeRotationInInteractAnimation = false;
			val.hasBeenCriticallyInjured = false;
			val.health = 100;
			((Behaviour)val.helmetLight).enabled = false;
			val.holdingWalkieTalkie = false;
			val.inAnimationWithEnemy = null;
			val.inShockingMinigame = false;
			val.inSpecialInteractAnimation = false;
			val.inVehicleAnimation = false;
			val.isClimbingLadder = false;
			val.isSinking = false;
			val.isUnderwater = false;
			Animator mapRadarDotAnimator = val.mapRadarDotAnimator;
			if (mapRadarDotAnimator != null)
			{
				mapRadarDotAnimator.SetBool("dead", false);
			}
			Animator playerBodyAnimator = val.playerBodyAnimator;
			if (playerBodyAnimator != null)
			{
				playerBodyAnimator.SetBool("Limp", false);
			}
			val.ResetZAndXRotation();
			val.sinkingValue = 0f;
			val.speakingToWalkieTalkie = false;
			AudioSource statusEffectAudio = val.statusEffectAudio;
			if (statusEffectAudio != null)
			{
				statusEffectAudio.Stop();
			}
			((Collider)val.thisController).enabled = true;
			((Component)val).transform.SetParent(StartOfRound.Instance.playersContainer);
			val.twoHanded = false;
			val.voiceMuffledByEnemy = false;
		}
	}
}