From 92abe54526dd4f37ce327caa0d3daab81057124d Mon Sep 17 00:00:00 2001 From: duckdoom4 <60387522+duckdoom4@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:15:54 +0200 Subject: [PATCH] Bug fixes --- pkNX.Containers/Misc/AHTBEntry.cs | 4 ++-- .../Dumpers/PersonalTable8LA.cs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkNX.Containers/Misc/AHTBEntry.cs b/pkNX.Containers/Misc/AHTBEntry.cs index 8745671b..04d0bbd1 100644 --- a/pkNX.Containers/Misc/AHTBEntry.cs +++ b/pkNX.Containers/Misc/AHTBEntry.cs @@ -26,8 +26,8 @@ public AHTBEntry(BinaryReader br) public void Write(BinaryWriter bw) { - bw.Write(Hash); - bw.Write(Name.Length + 1); + bw.Write((ulong)Hash); + bw.Write((ushort)(Name.Length + 1)); bw.Write(Name); bw.Write((byte)0); // \0 terminator } diff --git a/pkNX.Structures.FlatBuffers.Arceus/Dumpers/PersonalTable8LA.cs b/pkNX.Structures.FlatBuffers.Arceus/Dumpers/PersonalTable8LA.cs index 58ebfcc3..a2b23207 100644 --- a/pkNX.Structures.FlatBuffers.Arceus/Dumpers/PersonalTable8LA.cs +++ b/pkNX.Structures.FlatBuffers.Arceus/Dumpers/PersonalTable8LA.cs @@ -145,6 +145,13 @@ public void FixMissingData() for (byte f = 1; f < l.FormCount; f++) { var formL = Table[l.FormStatsIndex + (f - 1)]; + + if (formL.Form != f) + { + Debug.Assert(formL.Form == f); + formL.Form = f; + } + if (formL.HP != 0) continue;