Skip to content

Commit

Permalink
fix: Fixes missing reader seek for switches in gump response (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanomerotta committed Mar 9, 2024
1 parent 76f132f commit 1147a80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Projects/UOContent/Network/Packets/IncomingPlayerPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,13 @@ public static void DisplayGumpResponse(NetState state, SpanReader reader)
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;

Expand Down

0 comments on commit 1147a80

Please sign in to comment.