Decompiled source of ScanThruWalls v1.0.0

ScanThruWalls.dll

Decompiled 7 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("ScanThruWalls")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ScanThruWalls")]
[assembly: AssemblyTitle("ScanThruWalls")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ScanThruWalls;

[BepInPlugin("com.cream.lethalcompany.scanthruwalls", "Scan Thru Walls", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private readonly Harmony harmony = new Harmony("com.cream.lethalcompany.scanthruwalls");

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ScanThruWalls is loaded!");
		harmony.PatchAll();
	}
}
[HarmonyPatch(typeof(HUDManager))]
internal class HUDManagerPatcher
{
	[HarmonyPostfix]
	[HarmonyPatch("MeetsScanNodeRequirements")]
	private static void alterReqs(ScanNodeProperties node, ref bool __result, PlayerControllerB playerScript)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)node == (Object)null)
		{
			__result = false;
			return;
		}
		float num = Vector3.Distance(((Component)playerScript).transform.position, ((Component)node).transform.position);
		__result = num < (float)node.maxRange && num > (float)node.minRange;
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "ScanThruWalls";

	public const string PLUGIN_NAME = "ScanThruWalls";

	public const string PLUGIN_VERSION = "1.0.0";
}