mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-25 15:15:52 +00:00
fix(beastmaster): allow hatching pets when petOwned<=0 (fyi
@deilann). Man, browserify adds so many lines - this commit is a one-liner, lol
This commit is contained in:
parent
dcfa9e4724
commit
be986e09f6
2 changed files with 4810 additions and 4298 deletions
9106
dist/habitrpg-shared.js
vendored
9106
dist/habitrpg-shared.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -636,7 +636,7 @@ api.wrap = (user, main=true) ->
|
|||
return cb?({code:404,message:"Please specify query.egg & query.hatchingPotion"}) unless egg and hatchingPotion
|
||||
return cb?({code:401,message:"You're missing either that egg or that potion"}) unless user.items.eggs[egg] > 0 and user.items.hatchingPotions[hatchingPotion] > 0
|
||||
pet = "#{egg}-#{hatchingPotion}"
|
||||
return cb?("You already have that pet. Try hatching a different combination!") if user.items.pets[pet]
|
||||
return cb?("You already have that pet. Try hatching a different combination!") if user.items.pets[pet] and user.items.pets[pet] > 0
|
||||
user.items.pets[pet] = 5
|
||||
user.items.eggs[egg]--
|
||||
user.items.hatchingPotions[hatchingPotion]--
|
||||
|
|
|
|||
Loading…
Reference in a new issue