From bbcb09e2b8bab88eeff405e165f73fc231393ee7 Mon Sep 17 00:00:00 2001 From: TeMbI4 Date: Fri, 19 Jul 2024 22:56:26 +0200 Subject: [PATCH] Fix TotalCharges setter in WearState --- Exiled.API/Features/Items/Jailbird.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Exiled.API/Features/Items/Jailbird.cs b/Exiled.API/Features/Items/Jailbird.cs index 38c47abadf..1dedba66e9 100644 --- a/Exiled.API/Features/Items/Jailbird.cs +++ b/Exiled.API/Features/Items/Jailbird.cs @@ -119,8 +119,8 @@ public JailbirdWearState WearState get => Base._deterioration.WearState; set { + TotalCharges = (int)value; TotalDamageDealt = GetDamage(value); - TotalCharges = GetCharge(value); Base._deterioration.RecheckUsage(); } } @@ -150,22 +150,6 @@ public float GetDamage(JailbirdWearState wearState) throw new Exception("Wear state not found in charges to wear state mapping."); } - /// - /// Gets the charge needed to reach a specific . - /// - /// The desired wear state to calculate the charge for. - /// The charge value required to achieve the specified wear state. - public int GetCharge(JailbirdWearState wearState) - { - foreach (Keyframe keyframe in Base._deterioration._chargesToWearState.keys) - { - if (Base._deterioration.FloatToState(keyframe.value) == wearState) - return Mathf.RoundToInt(keyframe.time); - } - - throw new Exception("Wear state not found in charges to wear state mapping."); - } - /// /// Resets the Jailbird to normal. ///