From 1147a80b343ec4620e96c1b402e140f2bef16cd3 Mon Sep 17 00:00:00 2001 From: Stefano Merotta <97297186+stefanomerotta@users.noreply.github.com> Date: Sat, 9 Mar 2024 18:00:32 +0100 Subject: [PATCH] fix: Fixes missing reader seek for switches in gump response (#1700) --- Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs b/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs index 396311305..85bc44bad 100644 --- a/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs +++ b/Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs @@ -411,9 +411,13 @@ public static class IncomingPlayerPackets return; } + int switchByteCount = switchCount * 4; + // Read in all of the integers ReadOnlySpan switchBlock = - MemoryMarshal.Cast(reader.Buffer.Slice(reader.Position, switchCount * 4)); + MemoryMarshal.Cast(reader.Buffer.Slice(reader.Position, switchByteCount)); + + reader.Seek(switchByteCount, SeekOrigin.Current); scoped ReadOnlySpan switches;