Bug fixes

This commit is contained in:
duckdoom4
2023-09-09 20:15:54 +02:00
parent 78c21f21a9
commit 92abe54526
2 changed files with 9 additions and 2 deletions

View File

@@ -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
}

View File

@@ -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;