@@ -14,7 +14,7 @@ const getJson = require('./get-json');
14
14
15
15
let bsgData = false ;
16
16
let presets = false ;
17
- let sptPresets = false ;
17
+ let bsgPresets = false ;
18
18
const itemsByHash = { } ;
19
19
const itemsById = { } ;
20
20
@@ -322,11 +322,11 @@ const loadBsgData = async () => {
322
322
} ;
323
323
324
324
const loadPresets = async ( ) => {
325
- presets = await getJson . tt_presets ( ) ;
325
+ presets = await getJson . td_presets ( ) ;
326
326
} ;
327
327
328
- const loadSptPresets = async ( ) => {
329
- sptPresets = await getJson . presets ( ) ;
328
+ const loadBsgPresets = async ( ) => {
329
+ bsgPresets = await getJson . presets ( ) ;
330
330
} ;
331
331
332
332
const setBackgroundColor = ( item ) => {
@@ -379,14 +379,19 @@ const hashItems = async (options) => {
379
379
id
380
380
}
381
381
}
382
+ ...on ItemPropertiesWeapon {
383
+ slots {
384
+ name
385
+ }
386
+ }
382
387
}
383
388
}
384
389
}`
385
390
} ) ,
386
391
responseType : 'json' ,
387
392
resolveBodyOnly : true
388
393
} ) ;
389
- hashCalc . init ( bsgData , sptPresets , presets ) ;
394
+ hashCalc . init ( bsgData , bsgPresets , presets ) ;
390
395
let missingGridImage = 0 ;
391
396
let missingIcon = 0 ;
392
397
let missingBaseImage = 0 ;
@@ -420,7 +425,7 @@ const hashItems = async (options) => {
420
425
console . log ( `Error hashing ${ itemData . id } : ${ error } ` ) ;
421
426
}
422
427
itemsById [ itemData . id ] = itemData ;
423
- if ( itemData . id == options . targetItemId ) {
428
+ if ( itemData . id == options . targetItemId && itemData . hash ) {
424
429
console . log ( itemData . hash ) ;
425
430
break ;
426
431
}
@@ -445,7 +450,7 @@ const initialize = async (options) => {
445
450
if ( options . SCANNER_NAME ) process . env . SCANNER_NAME = options . SCANNER_NAME ;
446
451
await loadBsgData ( ) ;
447
452
await loadPresets ( ) ;
448
- await loadSptPresets ( ) ;
453
+ await loadBsgPresets ( ) ;
449
454
if ( ! options . skipHashing ) {
450
455
await hashItems ( opts ) ;
451
456
}
@@ -486,8 +491,8 @@ const generate = async (options, forceImageIndex) => {
486
491
if ( ! presets ) {
487
492
await loadPresets ( ) ;
488
493
}
489
- if ( ! sptPresets ) {
490
- await loadSptPresets ( ) ;
494
+ if ( ! bsgPresets ) {
495
+ await loadBsgPresets ( ) ;
491
496
}
492
497
if ( ! cacheIsLoaded ( ) ) {
493
498
refreshCache ( ) ;
@@ -531,7 +536,7 @@ const generate = async (options, forceImageIndex) => {
531
536
setBackgroundColor ( item ) ;
532
537
}
533
538
try {
534
- hashCalc . init ( bsgData , sptPresets , presets ) ;
539
+ hashCalc . init ( bsgData , bsgPresets , presets ) ;
535
540
item . hash = hashCalc . getItemHash ( item . id ) ;
536
541
if ( ! itemsByHash [ item . hash . toString ( ) ] ) {
537
542
itemsByHash [ item . hash . toString ( ) ] = item ;
0 commit comments