fix(core): Converts to ref struct enumerators (#426)
- [X] Converts boat moving entities to ref struct enumerator - [X] Converts skills to a ref struct enumerator - [X] Converts type cache to ref struct enumerator
This commit is contained in:
parent
c6ef6ff80a
commit
9ef7752beb
13 changed files with 352 additions and 198 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using Server.Factions;
|
||||
using Server.Multis;
|
||||
using Server.Network;
|
||||
|
|
@ -226,7 +225,28 @@ namespace Server.Items
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool CanClose() => Map != null && !Deleted && GetObjectsInRange(0).All(o => o == this);
|
||||
public bool CanClose()
|
||||
{
|
||||
if (Map == null || Deleted)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var eable = GetObjectsInRange(0);
|
||||
|
||||
foreach (var obj in eable)
|
||||
{
|
||||
if (obj == this)
|
||||
{
|
||||
eable.Free();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue