Skip to content

Commit

Permalink
fix: special are not "AllowedToFeed"
Browse files Browse the repository at this point in the history
  • Loading branch information
negue committed Nov 3, 2018
1 parent e9eddec commit 40693af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion 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();
Expand All @@ -18,7 +22,9 @@ 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) {
Expand Down Expand Up @@ -46,3 +52,4 @@ export function createAnimal (egg, potion, type, content, userItems) {
},
};
}

0 comments on commit 40693af

Please sign in to comment.