@rhyster/wow-casc-dbc 2.9.11 → 2.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1298,7 +1298,8 @@ class WDCReader {
1298
1298
  sectionPointer === sectionHeader.fileOffset,
1299
1299
  `Invalid section offset: ${sectionPointer.toString()} != ${sectionHeader.fileOffset.toString()}`
1300
1300
  );
1301
- const sectionSize = (isNormal ? sectionHeader.recordCount * recordSize + sectionHeader.stringTableSize : sectionHeader.offsetRecordsEnd - sectionPointer) + sectionHeader.idListSize + sectionHeader.copyTableCount * 8 + sectionHeader.offsetMapIDCount * 10 + sectionHeader.relationshipDataSize;
1301
+ const sectionRecordSize = isNormal ? sectionHeader.recordCount * recordSize + sectionHeader.stringTableSize : sectionHeader.offsetRecordsEnd - sectionPointer;
1302
+ const sectionSize = sectionRecordSize + sectionHeader.idListSize + sectionHeader.copyTableCount * 8 + sectionHeader.offsetMapIDCount * 10 + sectionHeader.relationshipDataSize;
1302
1303
  const recordDataSize = isNormal ? recordSize * sectionHeader.recordCount : sectionHeader.offsetRecordsEnd - sectionHeader.fileOffset;
1303
1304
  const isZeroed = blocks.some((block) => {
1304
1305
  const sectionStart = sectionHeader.fileOffset;
@@ -1448,7 +1449,10 @@ class WDCReader {
1448
1449
  };
1449
1450
  }
1450
1451
  case "commonData": {
1451
- const value = (recordID !== undefined ? commonData.get(fieldIndex)?.get(recordID) : undefined) ?? fieldInfo.defaultValue;
1452
+ let value = recordID !== undefined ? commonData.get(fieldIndex)?.get(recordID) : undefined;
1453
+ if (value === undefined) {
1454
+ value = fieldInfo.defaultValue;
1455
+ }
1452
1456
  return {
1453
1457
  type: "commonData",
1454
1458
  data: value