diff --git a/Projects/Server/Collections/PooledRefList.cs b/Projects/Server/Collections/PooledRefList.cs index 8aff2f7b3..f17476a44 100644 --- a/Projects/Server/Collections/PooledRefList.cs +++ b/Projects/Server/Collections/PooledRefList.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using Server.Buffers; namespace Server.Collections; @@ -152,14 +151,14 @@ public int Capacity if (_items.Length > 0) { - Clear(); + Array.Clear(_items); ArrayPool.Return(_items); } _items = newItems; } else { - Clear(); + Array.Clear(_items); ArrayPool.Return(_items); _items = s_emptyArray; } diff --git a/Projects/Server/Collections/PooledRefQueue.cs b/Projects/Server/Collections/PooledRefQueue.cs index cef14806a..deddb67de 100644 --- a/Projects/Server/Collections/PooledRefQueue.cs +++ b/Projects/Server/Collections/PooledRefQueue.cs @@ -305,7 +305,7 @@ private void SetCapacity(int capacity) if (_array.Length > 0) { - Clear(); + Array.Clear(_array); (_mt ? ArrayPool.Shared : STArrayPool.Shared).Return(_array); } diff --git a/Projects/UOContent/Accounting/AccountHandler.cs b/Projects/UOContent/Accounting/AccountHandler.cs index a8acf407f..12f9a9647 100644 --- a/Projects/UOContent/Accounting/AccountHandler.cs +++ b/Projects/UOContent/Accounting/AccountHandler.cs @@ -2,19 +2,10 @@ using System.Collections.Generic; using System.Net; using Server.Accounting; -using Server.Engines.CannedEvil; using Server.Engines.Help; -using Server.Engines.PlayerMurderSystem; -using Server.Engines.Virtues; using Server.Logging; using Server.Network; using Server.Regions; -using Server.Spells.Fifth; -using Server.Spells.First; -using Server.Spells.Mysticism; -using Server.Spells.Necromancy; -using Server.Spells.Ninjitsu; -using Server.Spells.Second; namespace Server.Misc; @@ -236,20 +227,6 @@ public static void DeleteRequest(NetState state, int index) m.Delete(); - StaminaSystem.OnPlayerDeleted(m); - JusticeVirtue.OnPlayerDeleted(m); - PlayerMurderSystem.OnPlayerDeleted(m); - ChampionTitleSystem.OnPlayerDeleted(m); - - // Spells - MagicReflectSpell.EndReflect(m); - ReactiveArmorSpell.EndArmor(m); - ProtectionSpell.EndProtection(m); - StoneFormSpell.RemoveEffects(m); - AnimateDeadSpell.RemoveEffects(m); - SummonFamiliarSpell.RemoveEffects(m); - AnimalForm.RemoveLastAnimalForm(m); - state.SendCharacterListUpdate(acct); return; } diff --git a/Projects/UOContent/Mobiles/PlayerMobile.cs b/Projects/UOContent/Mobiles/PlayerMobile.cs index 50956bc8c..806cb8cd2 100644 --- a/Projects/UOContent/Mobiles/PlayerMobile.cs +++ b/Projects/UOContent/Mobiles/PlayerMobile.cs @@ -28,9 +28,12 @@ using Server.Spells; using Server.Spells.Bushido; using Server.Spells.Fifth; +using Server.Spells.First; using Server.Spells.Fourth; +using Server.Spells.Mysticism; using Server.Spells.Necromancy; using Server.Spells.Ninjitsu; +using Server.Spells.Second; using Server.Spells.Seventh; using Server.Spells.Sixth; using Server.Spells.Spellweaving; @@ -3382,14 +3385,25 @@ public override void OnAfterDelete() base.OnAfterDelete(); var faction = Faction.Find(this); - faction?.RemoveMember(this); MLQuestSystem.HandleDeletion(this); - BaseHouse.HandleDeletion(this); - DisguisePersistence.RemoveTimer(this); + + StaminaSystem.OnPlayerDeleted(this); + JusticeVirtue.OnPlayerDeleted(this); + PlayerMurderSystem.OnPlayerDeleted(this); + ChampionTitleSystem.OnPlayerDeleted(this); + + // Spells + MagicReflectSpell.EndReflect(this); + ReactiveArmorSpell.EndArmor(this); + ProtectionSpell.EndProtection(this); + StoneFormSpell.RemoveEffects(this); + AnimateDeadSpell.RemoveEffects(this); + SummonFamiliarSpell.RemoveEffects(this); + AnimalForm.RemoveLastAnimalForm(this); } public override void GetProperties(IPropertyList list)