Fixed ftl.dat parsing when 0-byte resources are present

This commit is contained in:
Vhati 2018-01-22 03:07:44 -05:00
parent e76b0c67bd
commit 19233266d0
3 changed files with 12 additions and 1 deletions

View file

@ -11,6 +11,13 @@
"notice" : "Reminder: Return FTL to an unmodded state before upgrading SMM.\nAnd delete SMM's backups when upgrading FTL." "notice" : "Reminder: Return FTL to an unmodded state before upgrading SMM.\nAnd delete SMM's backups when upgrading FTL."
}, },
"changelog" : [ "changelog" : [
{
"version" : "1.9.2",
"hidden" : true,
"changes" : [
"Fixed ftl.dat parsing when 0-byte resources are present"
]
},
{ {
"version" : "1.9.1", "version" : "1.9.1",
"hidden" : false, "hidden" : false,

View file

@ -1,5 +1,8 @@
Changelog Changelog
1.9.2:
- Fixed ftl.dat parsing when 0-byte resources are present
1.9.1: 1.9.1:
- Edited a comment in boilerplate mod metadata to include AE ships - Edited a comment in boilerplate mod metadata to include AE ships
- Made the comments in boilerplace mod metadata optional - Made the comments in boilerplace mod metadata optional

View file

@ -419,7 +419,7 @@ public class PkgPack extends AbstractPack {
entry.dataSize = readBigUInt(); entry.dataSize = readBigUInt();
entry.unpackedSize = readBigUInt(); entry.unpackedSize = readBigUInt();
if ( entry.dataSize == 0 ) { // Null entry, dat wasn't repacked. if ( entry.dataOffset == 0 ) { // Null entry, dat wasn't repacked.
entryList.add( null ); entryList.add( null );
} else { } else {
entryList.add( entry ); entryList.add( entry );
@ -434,6 +434,7 @@ public class PkgPack extends AbstractPack {
for ( int i=0; i < entryCount; i++ ) { for ( int i=0; i < entryCount; i++ ) {
PkgEntry entry = entryList.get( i ); PkgEntry entry = entryList.get( i );
if ( entry == null ) continue;
bigByteBuf.position( entry.innerPathOffset ); bigByteBuf.position( entry.innerPathOffset );
entry.innerPath = readNullTerminatedString( bigByteBuf ); entry.innerPath = readNullTerminatedString( bigByteBuf );