fix: Fixes missing reader seek for switches in gump response (#1700)

This commit is contained in:
Stefano Merotta 2024-03-09 18:00:32 +01:00 committed by GitHub
parent 76f132fd49
commit 1147a80b34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -411,9 +411,13 @@ public static class IncomingPlayerPackets
return;
}
int switchByteCount = switchCount * 4;
// Read in all of the integers
ReadOnlySpan<int> switchBlock =
MemoryMarshal.Cast<byte, int>(reader.Buffer.Slice(reader.Position, switchCount * 4));
MemoryMarshal.Cast<byte, int>(reader.Buffer.Slice(reader.Position, switchByteCount));
reader.Seek(switchByteCount, SeekOrigin.Current);
scoped ReadOnlySpan<int> switches;