fix: Changes Map.Sector.Items to link list. (#1547)
### Summary
Eliminates `IPooledEnumerable<T>` and `eable.Free()` from `Map` for items. This drastically simplifies code that iterates in range, for example:
```cs
foreach (var item in m.GetItemsInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
This commit is contained in:
parent
1330c4a830
commit
24858f3989
42 changed files with 577 additions and 419 deletions
|
|
@ -2157,10 +2157,7 @@ public abstract class BaseAI
|
|||
Movement.Movement.Offset(d, ref x, ref y);
|
||||
|
||||
var destroyables = 0;
|
||||
|
||||
var eable = map.GetItemsInRange(new Point3D(x, y, m_Mobile.Location.Z), 1);
|
||||
|
||||
foreach (var item in eable)
|
||||
foreach (var item in map.GetItemsInRange(new Point3D(x, y, m_Mobile.Location.Z), 1))
|
||||
{
|
||||
if (canOpenDoors && item is BaseDoor door && door.Z + door.ItemData.Height > m_Mobile.Z &&
|
||||
m_Mobile.Z + 16 > door.Z)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue