From 58563d8cc14ba8814c8f02a0e608444a66466a17 Mon Sep 17 00:00:00 2001 From: baskwo Date: Sat, 1 May 2021 16:47:08 -0400 Subject: [PATCH] It's possible for a monster to have multiple drop sections. Check if the array is defined to push the values or set it. --- lib/modules/category-parsers/dofus/parsers/getMonsters.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/modules/category-parsers/dofus/parsers/getMonsters.js b/lib/modules/category-parsers/dofus/parsers/getMonsters.js index 3fcbca1..68539fa 100644 --- a/lib/modules/category-parsers/dofus/parsers/getMonsters.js +++ b/lib/modules/category-parsers/dofus/parsers/getMonsters.js @@ -93,7 +93,12 @@ function getMonsters(url) { } drops.push({ 'ankamaId': id, 'url': dropUrl, 'imgUrl': imgUrl, 'name': name, 'dropPercent': dropPercent }); }); - monster.drops = drops; + + if(monster.drops == undefined) { + monster.drops = drops; + } else { + monster.drops.push(drops); + } } });