This repository was archived by the owner on Apr 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -753,6 +753,15 @@ for (var i = 0; i < slots.length; i++) {
753753 var items = slots [ i ] . Items ;
754754 items . sort ( compareValues ( 'Name' ) ) ;
755755
756+ var itemSpecialEditions = { } ;
757+ for ( var item of items ) {
758+ if ( item . HasSpecialEditions === "true" ) {
759+ var editions = Products . SpecialEditions . filter ( function ( specialEdition ) { return item . AvailableSpecialEditions . indexOf ( specialEdition . ID ) !== - 1 } ) ;
760+ var editionName = editions [ 0 ] . Name ;
761+ itemSpecialEditions [ item . Name ] = editionName ;
762+ }
763+ }
764+
756765
757766 //VANILLA ITEMS
758767 for ( var j = 0 ; j < items . length ; j ++ ) {
@@ -765,14 +774,14 @@ for (var i = 0; i < slots.length; i++) {
765774 newOp . attr ( 'hasTeamEditions' , items [ j ] . HasTeamEditions ) ;
766775
767776 var itemName = items [ j ] . Name ;
777+
768778 // Parse Special Edition
769- if ( items [ j ] . HasSpecialEditions == "true" ) {
770- var editions = Products . SpecialEditions . filter ( function ( specialEdition ) { return items [ j ] . AvailableSpecialEditions . indexOf ( specialEdition . ID ) !== - 1 } ) ;
771- itemName += `: ${ editions [ 0 ] . Name } ` ;
779+ if ( items [ j ] . HasSpecialEditions === "false" && ! ! itemSpecialEditions [ items [ j ] . Name ] ) {
780+ itemName += `: ${ itemSpecialEditions [ items [ j ] . Name ] } ` ;
772781 }
773782
774783 // Parse Team Edition
775- if ( items [ j ] . HasTeamEditions == "true" ) {
784+ if ( items [ j ] . HasTeamEditions === "true" ) {
776785 itemName += ': Team Edition' ;
777786 }
778787
You can’t perform that action at this time.
0 commit comments