Skip to content

Commit

Permalink
🐛 fix item name with more than one "the"
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed May 20, 2022
1 parent 3fa3006 commit 629e459
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,27 @@ class Schema {
const items = this.raw.schema.items;
const itemsCount = items.length;

name = name.toLowerCase();

if (name.includes('the ')) {
const splits = name.split('the ');
splits.forEach(slipt => {
name = name.replace('the ', '').trim();
});
}

for (let i = 0; i < itemsCount; i++) {
const item = items[i];
if (name.toLowerCase().replace('the ', '').trim() === item.item_name.toLowerCase().replace('the ', '')) {
let itemName = item.item_name.toLowerCase();

if (itemName.includes('the ', '')) {
const splits = itemName.split('the ');
splits.forEach(slipt => {
itemName = itemName.replace('the ', '').trim();
});
}

if (name === itemName) {
if (item.item_name === 'Name Tag' && item.defindex === 2093) {
// skip and let it find Name Tag with defindex 5020
continue;
Expand Down

0 comments on commit 629e459

Please sign in to comment.