Skip to content

Commit

Permalink
Merge pull request #866 from osdanova/ObjectEditorFixes
Browse files Browse the repository at this point in the history
Kh2ObjectEditor - File overwrite fix
  • Loading branch information
shananas authored Sep 8, 2023
2 parents dbe39f0 + e8149ad commit 518636b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions OpenKh.Tools.Kh2ObjectEditor/Services/MdlxService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,20 @@ public void SaveModel()
switch (barEntry.Type)
{
case Bar.EntryType.Model:
barEntry.Stream.Position = 0;
barEntry.Stream = new MemoryStream();
ModelFile.Write(barEntry.Stream);
barEntry.Stream.Position = 0;
break;
case Bar.EntryType.ModelTexture:
barEntry.Stream.Position = 0;
barEntry.Stream = new MemoryStream();
TextureFile.Write(barEntry.Stream);
barEntry.Stream.Position = 0;
break;
case Bar.EntryType.ModelCollision:
barEntry.Stream.Position = 0;
barEntry.Stream = CollisionFile.toStream();
barEntry.Stream.Position = 0;
break;
case Bar.EntryType.Bdx:
barEntry.Stream.Position = 0;
barEntry.Stream = new MemoryStream();
BdxFile.CopyTo(barEntry.Stream);
barEntry.Stream.Position = 0;
Expand Down

0 comments on commit 518636b

Please sign in to comment.