mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
Merge branch 'master' into sestring_payloads_refactor
# Conflicts: # Dalamud/Game/Chat/SeStringHandling/Payloads/TextPayload.cs
This commit is contained in:
commit
75f563993d
2 changed files with 11 additions and 4 deletions
|
|
@ -93,7 +93,10 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
var payloadStartPos = reader.BaseStream.Position;
|
||||
|
||||
Payload payload = null;
|
||||
if ((byte)reader.PeekChar() != START_BYTE)
|
||||
|
||||
var initialByte = reader.ReadByte();
|
||||
reader.BaseStream.Position--;
|
||||
if (initialByte != START_BYTE)
|
||||
{
|
||||
payload = DecodeText(reader);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,11 +62,15 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
|||
|
||||
while (reader.BaseStream.Position < endOfStream)
|
||||
{
|
||||
if ((byte)reader.PeekChar() == START_BYTE)
|
||||
var nextByte = reader.ReadByte();
|
||||
if (nextByte == START_BYTE)
|
||||
{
|
||||
// rewind since this byte isn't part of this payload
|
||||
reader.BaseStream.Position--;
|
||||
break;
|
||||
}
|
||||
|
||||
// not the most efficient, but the easiest
|
||||
textBytes.Add(reader.ReadByte());
|
||||
textBytes.Add(nextByte);
|
||||
}
|
||||
|
||||
if (textBytes.Count > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue