From e2773d437ebe06f0439fa2c2e11d7af2f795f04c Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 1 Aug 2014 20:38:36 +0400 Subject: [PATCH] (Parser.Decrypt): less cryptic. --- ArcFormats/ArcYPF.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ArcFormats/ArcYPF.cs b/ArcFormats/ArcYPF.cs index 265218c2..b6136561 100644 --- a/ArcFormats/ArcYPF.cs +++ b/ArcFormats/ArcYPF.cs @@ -209,14 +209,15 @@ namespace GameRes.Formats public uint Decrypt (byte value) { - int pos = s_crypt_table.Length - 0x14; + int pos = 4; if (m_version >= 0x100) { - pos -= 4; if (m_version >= 0x12c && m_version < 0x196) - pos += 10; + pos = 10; + else + pos = 0; } - pos = Array.FindIndex (s_crypt_table, pos, x => x == value); + pos = Array.IndexOf (s_crypt_table, value, pos); if (-1 == pos) return value; if (0 != (pos & 1))