From 3efb3b661eed8d1a687c34537d51b1d0424a2f19 Mon Sep 17 00:00:00 2001 From: chudders1231 Date: Mon, 26 Jun 2023 16:42:42 +0100 Subject: [PATCH] Cleaned up code --- ConfigOptions.cs | 4 ---- Patches/CreatureDeathPatch.cs | 4 +++- Plugin.cs | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ConfigOptions.cs b/ConfigOptions.cs index 8e7819d..e37d1a0 100644 --- a/ConfigOptions.cs +++ b/ConfigOptions.cs @@ -1,8 +1,4 @@ using Nautilus.Options; -using BepInEx; -using BepInEx.Configuration; -using System.IO; -using Nautilus.Handlers; namespace CureBlade { diff --git a/Patches/CreatureDeathPatch.cs b/Patches/CreatureDeathPatch.cs index 61935c8..4f70dee 100644 --- a/Patches/CreatureDeathPatch.cs +++ b/Patches/CreatureDeathPatch.cs @@ -28,7 +28,9 @@ internal static void OnKillAsyncPrefix(CreatureDeath __instance) [HarmonyPrefix] internal static void OnTakeDamagePrefix( CreatureDeath __instance, DamageInfo damageInfo) { - __instance.gameObject.GetComponent().lastDamageType = damageInfo.type; + var customCreatureData = __instance.gameObject.GetComponent(); + + customCreatureData.lastDamageType = damageInfo.type; } public static IEnumerator SpawnCuredFish( GameObject origFish, TechType curedFish) diff --git a/Plugin.cs b/Plugin.cs index 8ea72a6..ffbaec3 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -4,7 +4,6 @@ using BepInEx; using CureBlade.Items.Equipment; using BepInEx.Configuration; -using System.IO; namespace CureBlade; @@ -32,7 +31,7 @@ private void Awake() harmony.PatchAll(); // Run additional functions prior to registering items - SetupBepinexConfigs(); + //SetupBepinexConfigs(); // Initialise custom prefabs InitializePrefabs();