Fix offset issue with imported addon files. Closes #1.

lua-bytecode
Icedream 2014-12-11 02:08:19 +01:00
parent 1294b5cacd
commit d35c00dbac
1 changed files with 2 additions and 1 deletions

View File

@ -176,6 +176,7 @@ namespace GarrysMod.AddonCreator.Addon
var filePath = file.Key;
var fileSize = file.Value.Item1;
var fileHash = file.Value.Item2;
var filePosition = sr.BaseStream.Position;
Debug.WriteLine("Extracting: {0} ({1:0.00} kB)", filePath, fileSize/1024);
@ -195,7 +196,7 @@ namespace GarrysMod.AddonCreator.Addon
throw new IOException("File " + filePath + " in addon file is corrupted (hash mismatch)");
}
Files.Add(filePath, new SegmentedAddonFileInfo(stream, sr.BaseStream.Position, fileSize, fileHash));
Files.Add(filePath, new SegmentedAddonFileInfo(stream, filePosition, fileSize, fileHash));
}
}
}