Skip to content

Commit

Permalink
Fix conditional writes in dynamic mode
Browse files Browse the repository at this point in the history
As reported by CLF78. He also suggested a fix, but I did it a bit differently here. This is the only place WordUtils was used, and it was by mistake, at that -- so getting rid of it entirely should help prevent similar mistakes in the future.
  • Loading branch information
RoadrunnerWMC committed Jan 18, 2024
1 parent 284b7e8 commit f88e308
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion Kamek/Commands/WriteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public override void WriteArguments(BinaryWriter bw)
if (Original.HasValue)
{
Original.Value.AssertNotRelative();
bw.WriteBE(Original.Value);
bw.WriteBE(Original.Value.Value);
}
}

Expand Down
10 changes: 0 additions & 10 deletions Kamek/Word.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,4 @@ public override string ToString()
throw new NotImplementedException();
}
}


public static class WordUtils
{
public static void WriteBE(this BinaryWriter bw, Word word)
{
bw.Write((byte)word.Type);
bw.WriteBE((uint)word.Value);
}
}
}

0 comments on commit f88e308

Please sign in to comment.