fix(core): Cleans up uninitialized packets (#397)
- [X] Encapsulates/abstracts buffer cache checking - [X] Changes mobile moving cache to use Span2D
This commit is contained in:
parent
0b9fb9c071
commit
8763be8a21
18 changed files with 417 additions and 529 deletions
|
|
@ -87,16 +87,11 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
Span<byte> buffer = stackalloc byte[OutgoingEffectPackets.SoundPacketLength];
|
||||
buffer.InitializePacket();
|
||||
Span<byte> buffer = stackalloc byte[OutgoingEffectPackets.SoundPacketLength].InitializePacket();
|
||||
|
||||
foreach (var state in GetClientsInRange(2))
|
||||
{
|
||||
if (buffer[0] == 0)
|
||||
{
|
||||
OutgoingEffectPackets.CreateSoundEffect(buffer, 0x127, GetWorldLocation());
|
||||
}
|
||||
|
||||
OutgoingEffectPackets.CreateSoundEffect(buffer, 0x127, GetWorldLocation());
|
||||
state.Send(buffer);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue