Decompiled source of NoSprayOnShip v1.0.0

NoSprayOnShip.dll

Decompiled 6 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 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("Spray")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Spray")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3d9bc82c-85d3-47a5-9623-eed9f5af2235")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoSprayOnShip;

[BepInPlugin("qh3.NoSprayOnShip", "NoSprayOnShip", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public static Plugin Instance;

	private static readonly Harmony harmony = new Harmony("qh3.NoSprayOnShip");

	internal static ManualLogSource Log = Logger.CreateLogSource("qh3.NoSprayOnShip");

	private void Awake()
	{
		Log.LogInfo((object)"Loading NoSprayOnShip Mod");
		Instance = this;
		harmony.PatchAll(typeof(SprayPaintItem_Patch));
	}
}
[HarmonyPatch(typeof(SprayPaintItem))]
internal class SprayPaintItem_Patch
{
	[HarmonyPatch("AddSprayPaintLocal")]
	[HarmonyPrefix]
	private static bool AddSprayPaintLocalPrefix(SprayPaintItem __instance, ref bool __result, Vector3 sprayPos, Vector3 sprayRot)
	{
		if ((Object)(object)((GrabbableObject)__instance).playerHeldBy != (Object)null && ((GrabbableObject)__instance).playerHeldBy.isInHangarShipRoom)
		{
			__result = false;
			return false;
		}
		return true;
	}
}