mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Merge pull request #99 from ff-meli/master
This commit is contained in:
commit
299ca5daca
2 changed files with 11 additions and 4 deletions
|
|
@ -30,7 +30,10 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
|||
public static Payload Process(BinaryReader reader)
|
||||
{
|
||||
Payload payload = null;
|
||||
if ((byte)reader.PeekChar() != START_BYTE)
|
||||
|
||||
var initialByte = reader.ReadByte();
|
||||
reader.BaseStream.Position--;
|
||||
if (initialByte != START_BYTE)
|
||||
{
|
||||
payload = ProcessText(reader);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,11 +58,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
|
||||
text.Add(reader.ReadByte());
|
||||
text.Add(nextByte);
|
||||
}
|
||||
|
||||
if (text.Count > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue