fix: Adds GetClients to map iterators (#1574)
### Summary
Eliminates `IPooledEnumerable<NetState>` and `eable.Free()` from `Map` for clients. This drastically simplifies code that iterates in range, for example:
```cs
foreach (var m in m.GetClientsInRange(5))
{
}
```
The code above no longer requires an eable and calling `Free()`.
This commit is contained in:
parent
469b89370d
commit
cde59a82f2
13 changed files with 347 additions and 162 deletions
|
|
@ -370,11 +370,9 @@ public partial class CharacterStatue : Mobile, IRewardItem
|
|||
}
|
||||
|
||||
ProcessDelta();
|
||||
|
||||
var eable = Map.GetClientsInRange(Location);
|
||||
Span<byte> animPacket = stackalloc byte[CharacterStatuePackets.StatueAnimationPacketLength].InitializePacket();
|
||||
|
||||
foreach (var state in eable)
|
||||
foreach (var state in Map.GetClientsInRange(Location))
|
||||
{
|
||||
state.Mobile.ProcessDelta();
|
||||
CharacterStatuePackets.CreateStatueAnimation(animPacket, Serial, 1, m_Animation, m_Frames);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue