From d6f77915f8decd7ef493da6a283de731140b507e Mon Sep 17 00:00:00 2001 From: Yohoki <44595371+Yohoki@users.noreply.github.com> Date: Wed, 15 Mar 2023 02:24:00 -0500 Subject: [PATCH] - Fixed all loading and encoding bugs (hopefully) At this point, the tool can decode ShadowBLink bnk file and create, from given data, a 1-1 copy. --- BNK-Editor/Hierarchy.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BNK-Editor/Hierarchy.cs b/BNK-Editor/Hierarchy.cs index 6b3c58f..63c3403 100644 --- a/BNK-Editor/Hierarchy.cs +++ b/BNK-Editor/Hierarchy.cs @@ -164,7 +164,9 @@ public void GenPropsData() for (int i=0; i < PropsCount; i++) { propsT[i] = Convert.ToByte(propsType[i]); - propsV = propsV.Concat(Utils.ToHex(propsValues[i])).ToArray(); + if (propsType[i] == 0x3A || propsType[i] == 0x07) // Loops need to be int32, not float + { propsV = propsV.Concat(Utils.ToHex(Convert.ToInt32(propsValues[i]))).ToArray(); } + else propsV = propsV.Concat(Utils.ToHex(propsValues[i])).ToArray(); } _raw_PropsData = new byte[1]; _raw_PropsData[0] = Utils.ToHexByte(PropsCount);