HabitRPG/habitrpg-shared — pull request #79 by SabreCat (2014-01-07 14:20:55+00:00)
Title: Server side of Rebirth-related fix: don't remove Wolf Eggs upon drops unlock

Previously, if user had >1 Wolf Egg, performed a Rebirth, then unlocked drops again, they would be reset to 1 Wolf Egg. Now Habit checks to see if they have some Wolf Eggs already, and if so, gives them one instead of setting the quantity to one.

Question for @lefnire / @paglias: I'm being careful about not performing a `++` on an undefined quantity. Is that the right code practice, or will JS turn an undefined into a 1 if the type is number and I add to it?