File tree Expand file tree Collapse file tree
Projects/UOContent/Mobiles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3839,21 +3839,19 @@ public override void OnDelete()
38393839 if ( _allFollowers ? . Count > 0 )
38403840 {
38413841 // Releasing or deleting a follower removes it from _allFollowers.
3842- using var followers = PooledRefList < BaseCreature > . Create ( _allFollowers . Count ) ;
3842+ using var followers = PooledRefQueue < BaseCreature > . Create ( _allFollowers . Count ) ;
38433843
38443844 foreach ( var follower in _allFollowers )
38453845 {
38463846 // Escorts and hirelings notice a deleted master and walk off on their own.
38473847 if ( follower is BaseCreature bc and not ( BaseEscortable or BaseHire ) )
38483848 {
3849- followers . Add ( bc ) ;
3849+ followers . Enqueue ( bc ) ;
38503850 }
38513851 }
38523852
3853- for ( var i = 0 ; i < followers . Count ; i ++ )
3853+ while ( followers . TryDequeue ( out var bc ) )
38543854 {
3855- var bc = followers [ i ] ;
3856-
38573855 if ( bc . Summoned || bc . IsBonded || bc . IsDeadPet )
38583856 {
38593857 bc . Delete ( ) ;
You can’t perform that action at this time.
0 commit comments