mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-29 20:24:53 +01:00
fix(potions): erroneous Ghost overbuy warnings
This commit is contained in:
@@ -554,12 +554,16 @@ export default {
|
||||
}
|
||||
|
||||
const ownedPets = reduce(this.user.items.pets, (sum, petValue, petKey) => {
|
||||
if (petKey.includes(this.item.key) && petValue > 0) return sum + 1;
|
||||
if (petKey.includes(this.item.key) && petValue > 0
|
||||
&& !petKey.includes('JackOLantern') // Jack-O-Lantern has "Ghost" version
|
||||
) return sum + 1;
|
||||
return sum;
|
||||
}, 0);
|
||||
|
||||
const ownedMounts = reduce(this.user.items.mounts, (sum, mountValue, mountKey) => {
|
||||
if (mountKey.includes(this.item.key) && mountValue === true) return sum + 1;
|
||||
if (mountKey.includes(this.item.key) && mountValue === true
|
||||
&& !mountKey.includes('JackOLantern')
|
||||
) return sum + 1;
|
||||
return sum;
|
||||
}, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user