From 611f7d712a36a19c818793dfba02e029e11daf3f Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 20 Oct 2016 09:03:23 +0400 Subject: [PATCH] (BinaryStream): swapped ReadInt8 and ReadUInt8. --- GameRes/BinaryStream.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GameRes/BinaryStream.cs b/GameRes/BinaryStream.cs index 6e4b5161..a8f07737 100644 --- a/GameRes/BinaryStream.cs +++ b/GameRes/BinaryStream.cs @@ -232,14 +232,14 @@ namespace GameRes public sbyte ReadInt8 () { - if (1 != FillBuffer (1)) - throw new EndOfStreamException(); - return (sbyte)m_buffer[m_buffer_pos++]; + return (sbyte)ReadUInt8(); } public byte ReadUInt8 () { - return (byte)ReadInt8(); + if (1 != FillBuffer (1)) + throw new EndOfStreamException(); + return m_buffer[m_buffer_pos++]; } public short ReadInt16 () @@ -516,14 +516,14 @@ namespace GameRes public sbyte ReadInt8 () { - if (m_position >= m_length) - throw new EndOfStreamException(); - return (sbyte)m_source[m_start+m_position++]; + return (sbyte)ReadInt8(); } public byte ReadUInt8 () { - return (byte)ReadInt8(); + if (m_position >= m_length) + throw new EndOfStreamException(); + return m_source[m_start+m_position++]; } public short ReadInt16 ()