From e604e8cf43840d3f2f7d68456eb0f494e043a278 Mon Sep 17 00:00:00 2001 From: Abbysssal <55982389+Abbysssal@users.noreply.github.com> Date: Tue, 11 May 2021 15:41:10 +0700 Subject: [PATCH] a couple of fixes --- RogueLibsCore/Hooks/Items/CustomItemInfo.cs | 6 +++--- RogueLibsCore/Hooks/Unlocks/UnlockWrapper.cs | 2 +- RogueLibsCore/Patches/Patches_TraitsStatusEffects.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RogueLibsCore/Hooks/Items/CustomItemInfo.cs b/RogueLibsCore/Hooks/Items/CustomItemInfo.cs index 285561856..a0eb54d57 100644 --- a/RogueLibsCore/Hooks/Items/CustomItemInfo.cs +++ b/RogueLibsCore/Hooks/Items/CustomItemInfo.cs @@ -85,11 +85,11 @@ private CustomItemInfo(Type type) } if (typeof(IItemTargetable).IsAssignableFrom(type)) { - IgnoreChecks_TargetFilter = type.GetInterfaceMethod(typeof(IItemCombinable), + IgnoreChecks_TargetFilter = type.GetInterfaceMethod(typeof(IItemTargetable), nameof(IItemTargetable.TargetFilter)).GetCustomAttribute()?.IgnoredChecks ?? RogueUtilities.Empty; - IgnoreChecks_TargetObject = type.GetInterfaceMethod(typeof(IItemCombinable), + IgnoreChecks_TargetObject = type.GetInterfaceMethod(typeof(IItemTargetable), nameof(IItemTargetable.TargetObject)).GetCustomAttribute()?.IgnoredChecks ?? RogueUtilities.Empty; - IgnoreChecks_TargetObject = type.GetInterfaceMethod(typeof(IItemCombinable), + IgnoreChecks_TargetObject = type.GetInterfaceMethod(typeof(IItemTargetable), nameof(IItemTargetable.TargetTooltip)).GetCustomAttribute()?.IgnoredChecks ?? RogueUtilities.Empty; } } diff --git a/RogueLibsCore/Hooks/Unlocks/UnlockWrapper.cs b/RogueLibsCore/Hooks/Unlocks/UnlockWrapper.cs index 9eac2658e..7b5b0cbd7 100644 --- a/RogueLibsCore/Hooks/Unlocks/UnlockWrapper.cs +++ b/RogueLibsCore/Hooks/Unlocks/UnlockWrapper.cs @@ -17,9 +17,9 @@ public abstract class UnlockWrapper : IHook /// Determines whether the unlock is unlocked from the start. protected UnlockWrapper(string name, string type, bool unlockedFromStart) { + Unlock = new Unlock(name, type, unlockedFromStart) { __RogueLibsCustom = this }; Name = name; Type = type; - Unlock = new Unlock(name, type, unlockedFromStart) { __RogueLibsCustom = this }; } internal UnlockWrapper(Unlock unlock) { diff --git a/RogueLibsCore/Patches/Patches_TraitsStatusEffects.cs b/RogueLibsCore/Patches/Patches_TraitsStatusEffects.cs index e6a3da560..1e512d841 100644 --- a/RogueLibsCore/Patches/Patches_TraitsStatusEffects.cs +++ b/RogueLibsCore/Patches/Patches_TraitsStatusEffects.cs @@ -31,9 +31,9 @@ public void PatchTraitsAndStatusEffects() new Type[] { typeof(string), typeof(bool) }); #pragma warning disable CS0618 // NetworkInstanceId is obsolete - Patcher.Prefix(typeof(StatusEffects), nameof(StatusEffects.RemoveTrait), nameof(StatusEffects_RemoveTrait_Prefix), + Patcher.Prefix(typeof(StatusEffects), nameof(StatusEffects.RemoveStatusEffect), nameof(StatusEffects_RemoveStatusEffect_Prefix), new Type[] { typeof(string), typeof(bool), typeof(NetworkInstanceId), typeof(bool) }); - Patcher.Postfix(typeof(StatusEffects), nameof(StatusEffects.RemoveTrait), + Patcher.Postfix(typeof(StatusEffects), nameof(StatusEffects.RemoveStatusEffect), new Type[] { typeof(string), typeof(bool), typeof(NetworkInstanceId), typeof(bool) }); #pragma warning restore CS0618 @@ -41,7 +41,7 @@ public void PatchTraitsAndStatusEffects() Patcher.Postfix(typeof(StatusEffects), nameof(StatusEffects.GetStatusEffectHate)); Patcher.Prefix(typeof(StatusEffects), nameof(StatusEffects.UpdateStatusEffect)); - Patcher.Prefix(typeof(StatusEffects), nameof(StatusEffects.UpdateTrait)); + // Patcher.Prefix(typeof(StatusEffects), nameof(StatusEffects.UpdateTrait)); } ///