Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildLists: function () {
- var i, j, k, items;
- this.validIngredients = [];
- this.neededIngredients = [];
- items = me.getItems(-1, 0);
- for (i = 0; i < this.recipes.length; i += 1) {
- IngredientLoop: for (j = 0; j < this.recipes[i].Ingredients.length; j += 1) {
- for (k = 0; k < items.length; k += 1) {
- if ((this.recipes[i].Ingredients[j] === "pgem" && [566, 571, 576, 581, 586, 601].indexOf(items[k].classid) > -1 || items[k].classid === this.recipes[i].Ingredients[j]) && this.validItem(items[k], this.recipes[i])) {
- this.validIngredients.push({classid: items[k].classid, gid: items[k].gid});
- items.splice(k, 1); // Remove from item list to prevent counting the same item more than once
- continue IngredientLoop;
- }
- }
- this.neededIngredients.push({classid: this.recipes[i].Ingredients[j], recipe: this.recipes[i]});
- }
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement