diff --git a/GameRes/ByteArray.cs b/GameRes/ByteArray.cs index eb352238..0b89268c 100644 --- a/GameRes/ByteArray.cs +++ b/GameRes/ByteArray.cs @@ -70,12 +70,15 @@ namespace GameRes public int IndexOf (T item) { - return Array.IndexOf (m_source, item, m_offset, m_count); + int i = Array.IndexOf (m_source, item, m_offset, m_count); + if (-1 == i) + return i; + return i - m_offset; } public bool Contains (T item) { - return IndexOf (item) != -1; + return Array.IndexOf (m_source, item, m_offset, m_count) != -1; } public void CopyTo (T[] arr, int dst)