diff --git a/website/client/libs/createAnimal.js b/website/client/libs/createAnimal.js index 34b99e024f..e464fb09d6 100644 --- a/website/client/libs/createAnimal.js +++ b/website/client/libs/createAnimal.js @@ -1,4 +1,8 @@ +import content from 'common/script/content'; + +const specialPets = Object.keys(content.specialPets); + function getText (textOrFunction) { if (textOrFunction instanceof Function) { return textOrFunction(); @@ -18,10 +22,12 @@ export function isHatchable (animal, userItems) { } export function isAllowedToFeed (animal, userItems) { - return isOwned('pet', animal, userItems) && !isOwned('mount', animal, userItems); + return !specialPets.includes(animal.key) && + isOwned('pet', animal, userItems) && + !isOwned('mount', animal, userItems); } -export function createAnimal (egg, potion, type, content, userItems) { +export function createAnimal (egg, potion, type, _content, userItems) { let animalKey = `${egg.key}-${potion.key}`; return { @@ -31,7 +37,7 @@ export function createAnimal (egg, potion, type, content, userItems) { eggName: getText(egg.text), potionKey: potion.key, potionName: getText(potion.text), - name: content[`${type}Info`][animalKey].text(), + name: _content[`${type}Info`][animalKey].text(), isOwned () { return isOwned(type, this, userItems); }, @@ -46,3 +52,4 @@ export function createAnimal (egg, potion, type, content, userItems) { }, }; } +