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:
Kamron Batman 2023-10-16 20:51:02 -07:00 • committed by GitHub
parent 1330c4a830
commit 24858f3989
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 577 additions and 419 deletions

View file

@ -1,4 +1,3 @@
using System.Linq;
using ModernUO.Serialization;
using Server.Mobiles;
@ -268,9 +267,15 @@ namespace Server.Items
public static SHTeleporter FindSHTeleporter(Map map, Point3D p)
{
var eable = map.GetItemsInRange<SHTeleporter>(p, 0);
var teleporter = eable.FirstOrDefault(item => item.Z == p.Z);
return teleporter;
foreach (var teleporter in map.GetItemsInRange<SHTeleporter>(p, 0))
{
if (teleporter.Z == p.Z)
{
return teleporter;
}
}
return null;
}
public SHTeleporter AddSHT(Map map, bool ext, int x, int y, int z)