Fixed, Script Editor: MD5 hash of text files stored in PK3 was calculated incorrectly, resulting in false warning messages when saving.

This commit is contained in:
MaxED 2016-12-22 00:03:58 +00:00
parent cfc92d9075
commit d73ea867a4
3 changed files with 8 additions and 2 deletions

View file

@ -584,6 +584,9 @@ namespace CodeImp.DoomBuilder.Data
File.WriteAllBytes(location.location, savestream.ToArray());
}
// Rewind the stream (because DirectoryReader/WADReader don't modify stream Position in SaveFile)
stream.Position = 0;
return true;
}

View file

@ -10,10 +10,13 @@ namespace CodeImp.DoomBuilder
public static string Get(Stream stream)
{
// Rewind the stream
stream.Position = 0;
// Check hash
byte[] data = hasher.ComputeHash(stream);
// Rewind the stream
// Rewind the stream again...
stream.Position = 0;
// Create a new Stringbuilder to collect the bytes and create a string.

View file

@ -1263,7 +1263,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.UndoRedo.CreateUndo("Paste properties to " + rest);
BuilderPlug.Me.CopiedThingProps.Apply(sel, false);
foreach(Thing t in sel) t.UpdateConfiguration();
General.Interface.DisplayStatus(StatusType.Action, "Pasted properties to" + rest + ".");
General.Interface.DisplayStatus(StatusType.Action, "Pasted properties to " + rest + ".");
// Update
General.Map.IsChanged = true;