mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
* Only unequip Gen 1 pets/mounts when releasing pets/mounts * Changed mount declaration to match releasePets * Check if a pet/mount is a drop type instead of checking for its name in the list of pets * Changed references to pet and mount to petInfo and mountInfo for consistency with releasePets and releaseMounts * Test that releasePets, releaseMounts, and releaseBoth do not unequip quest pets * Fixed test names, and tests verify that a pet/mount is/is not a drop pet/mount on release * Removed unneeded comments
This commit is contained in:
committed by
Blade Barringer
parent
2e2dc179c4
commit
d2756278c3
@@ -29,8 +29,17 @@ module.exports = function releaseBoth (user, req = {}, analytics) {
|
||||
user.balance -= 1.5;
|
||||
}
|
||||
|
||||
user.items.currentMount = '';
|
||||
user.items.currentPet = '';
|
||||
let mountInfo = content.mountInfo[user.items.currentMount];
|
||||
|
||||
if (mountInfo && mountInfo.type === 'drop') {
|
||||
user.items.currentMount = '';
|
||||
}
|
||||
|
||||
let petInfo = content.petInfo[user.items.currentPet];
|
||||
|
||||
if (petInfo && petInfo.type === 'drop') {
|
||||
user.items.currentPet = '';
|
||||
}
|
||||
|
||||
for (animal in content.pets) {
|
||||
if (user.items.pets[animal] === -1) {
|
||||
|
||||
Reference in New Issue
Block a user