madden-franchise 2.4.1 → 2.4.2

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.
Files changed (2) hide show
  1. package/FranchiseFile.js +8 -1
  2. package/package.json +1 -1
package/FranchiseFile.js CHANGED
@@ -292,7 +292,7 @@ class FranchiseFile extends EventEmitter {
292
292
 
293
293
  if (referencedTable) {
294
294
  const fullBinary = utilService.getBinaryReferenceData(tableId, recordIndex);
295
- const hex = utilService.bin2hex(fullBinary);
295
+ const hex = utilService.bin2hex(fullBinary).padStart(8, '0');
296
296
 
297
297
  return this.tables.filter((table) => {
298
298
  if (table.schema) {
@@ -300,6 +300,13 @@ class FranchiseFile extends EventEmitter {
300
300
  return attribute.type === referencedTable.name;
301
301
  });
302
302
  }
303
+ else if (table.isArray && referencedTable.schema) {
304
+ // If the referenced table has a schema, we can check its base name.
305
+ // Some array table names are by the base name like EnumTable[] can contain AwardTypeEnumTableEntry
306
+
307
+ return table.name.slice(0, table.name.length - 2) === referencedTable.name
308
+ || table.name.slice(0, table.name.length - 2) === referencedTable.schema.base;
309
+ }
303
310
  else if (table.isArray) {
304
311
  return table.name.slice(0, table.name.length - 2) === referencedTable.name;
305
312
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madden-franchise",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Tools to read a madden franchise file and get data from it",
5
5
  "main": "FranchiseFile.js",
6
6
  "scripts": {