fix: Adds multis to map iterators, fixes searching empty nested containers (#1581)
### Summary
Eliminates `IPooledEnumerable<BaseMulti>` and `eable.Free()` from `Map` for multis. This drastically simplifies code that iterates in range, for example:
```cs
foreach (var m in m.GetMultisInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
### Bug Fixes
- [X] Fixes an issue with searching through nested empty containers.
This commit is contained in:
parent
1f04a13f67
commit
ca3df9cfa7
12 changed files with 960 additions and 860 deletions
|
|
@ -243,11 +243,9 @@ namespace Server.Multis
|
|||
|
||||
public static BaseBoat FindBoatAt(Point3D loc, Map map)
|
||||
{
|
||||
var sector = map.GetSector(loc);
|
||||
|
||||
for (var i = 0; i < sector.Multis.Count; i++)
|
||||
foreach (var boat in map.GetMultisAt<BaseBoat>(loc))
|
||||
{
|
||||
if (sector.Multis[i] is BaseBoat boat && boat.Contains(loc.X, loc.Y))
|
||||
if (boat.Contains(loc.X, loc.Y))
|
||||
{
|
||||
return boat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue