fix: Cleans up mobile status packets (#835)
* Removes Span2D for mobile moving. Instead uses pure math and simplifies the calculation. * Cleans up the extended mobile status packet.
This commit is contained in:
parent
e873d2ed7e
commit
651cffa872
3 changed files with 49 additions and 47 deletions
|
|
@ -17,7 +17,6 @@ using System;
|
|||
using System.Buffers;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Toolkit.HighPerformance;
|
||||
|
||||
namespace Server.Network
|
||||
{
|
||||
|
|
@ -55,12 +54,12 @@ namespace Server.Network
|
|||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Span2D<byte> InitializePackets(this Span2D<byte> buffer)
|
||||
public static Span<byte> InitializePackets(this Span<byte> buffer, int width)
|
||||
{
|
||||
#if NO_LOCAL_INIT
|
||||
for (var i = 0; i < buffer.Height; i++)
|
||||
for (var i = 0; i < buffer.Length; i += width)
|
||||
{
|
||||
buffer.GetRowSpan(i)[0] = 0;
|
||||
buffer[i] = 0;
|
||||
}
|
||||
#endif
|
||||
return buffer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue