Merge branch 'master' into sestring_payloads_refactor

# Conflicts:
#	Dalamud/Game/Chat/SeStringHandling/Payloads/TextPayload.cs
This commit is contained in:
meli 2020-04-26 14:54:59 -07:00
commit 75f563993d
2 changed files with 11 additions and 4 deletions

View file

@ -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);
}

View file

@ -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)