Fixed saving file with unusual offset value

This commit is contained in:
G2-Games 2024-09-19 02:07:00 -05:00
parent c6404f6a09
commit a93ba81859

View file

@ -279,12 +279,12 @@ impl Pak {
for entry in self.entries() { for entry in self.entries() {
//let block_size = entry.data.len().div_ceil(self.header().block_size as usize); //let block_size = entry.data.len().div_ceil(self.header().block_size as usize);
let mut remainder = 2048 let mut remainder = self.header().block_size as usize
- entry - entry
.data .data
.len() .len()
.rem_euclid(self.header().block_size as usize); .rem_euclid(self.header().block_size as usize);
if remainder == 2048 { if remainder == self.header().block_size as usize {
remainder = 0; remainder = 0;
} }
output.write_all(&entry.data)?; output.write_all(&entry.data)?;