mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 11:40:25 +00:00
pets: fix to not being able to select pet right after hatching
This commit is contained in:
parent
4af56b998f
commit
e8848ba0ad
1 changed files with 2 additions and 2 deletions
|
|
@ -29,14 +29,14 @@ module.exports.app = (appExports, model) ->
|
|||
myFood = user.get 'items.food'
|
||||
egg = model.get '_feedEgg'
|
||||
eggs = user.get 'items.eggs'
|
||||
pets = user.get 'items.pets'
|
||||
myPets = user.get 'items.pets'
|
||||
|
||||
foodIdx = myFood.indexOf foodName
|
||||
eggIdx = eggs.indexOf egg
|
||||
|
||||
return alert "You don't own that food :\\" if foodIdx is -1
|
||||
return alert "You don't own that egg :\\" if eggIdx is -1
|
||||
return alert "You already have that pet." if pets and pets.indexOf("#{egg.name}-#{foodName}") != -1
|
||||
return alert "You already have that pet." if myPets and myPets.indexOf("#{egg.name}-#{foodName}") != -1
|
||||
|
||||
user.push 'items.pets', egg.name + '-' + foodName
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue