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
|
|
@ -141,9 +141,7 @@ namespace Server.Spells.Seventh
|
|||
|
||||
private static bool GateExistsAt(Map map, Point3D loc)
|
||||
{
|
||||
var eable = map.GetItemsInRange(loc, 0);
|
||||
|
||||
foreach (var item in eable)
|
||||
foreach (var item in map.GetItemsInRange(loc, 0))
|
||||
{
|
||||
if (item is Moongate or PublicMoongate)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -97,9 +97,7 @@ namespace Server.Spells.Spellweaving
|
|||
}
|
||||
}
|
||||
|
||||
var eable = map.GetItemsInRange(location, 0);
|
||||
|
||||
foreach (var item in eable)
|
||||
foreach (var item in map.GetItemsInRange(location, 0))
|
||||
{
|
||||
if (item.Z + item.ItemData.CalcHeight == location.Z && IsValidTile(item.ItemID))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,9 +96,7 @@ namespace Server.Spells.Third
|
|||
|
||||
m.PlaySound(0x1FE);
|
||||
|
||||
var eable = m.GetItemsInRange(0);
|
||||
|
||||
foreach (var item in eable)
|
||||
foreach (var item in m.GetItemsInRange(0))
|
||||
{
|
||||
if (item is ParalyzeFieldSpell.InternalItem or
|
||||
PoisonFieldSpell.InternalItem or FireFieldSpell.FireFieldItem)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue