diff --git a/server/src/models/Pokemon.js b/server/src/models/Pokemon.js index 7e8decf0a..811562d4d 100644 --- a/server/src/models/Pokemon.js +++ b/server/src/models/Pokemon.js @@ -237,7 +237,9 @@ class Pokemon extends Model { ? Object.values(filterMap).flatMap((filter) => filter.buildApiFilter()) : [] if ((perms.iv || perms.pvp) && mem) { - filters.push(...globalFilter.buildApiFilter()) + const pokemon = Object.keys(filterMap).filter(key => key.includes('-')) + pokemon.push('') // add everything else + filters.push(...globalFilter.buildApiFilter(pokemon)) if (onlyZeroIv) filters.push({ iv: [0, 0] }) if (onlyHundoIv) filters.push({ iv: [100, 100] }) } diff --git a/server/src/services/filters/pokemon/Backend.js b/server/src/services/filters/pokemon/Backend.js index 97b7bc317..fcacecbd7 100644 --- a/server/src/services/filters/pokemon/Backend.js +++ b/server/src/services/filters/pokemon/Backend.js @@ -260,7 +260,7 @@ module.exports = class PkmnBackend { * Build the API filter for Golbat * @returns {import('../../../types').DnfFilter[]} */ - buildApiFilter() { + buildApiFilter(pokemon = undefined) { const { enabled: _enabled, size: _size, @@ -276,7 +276,7 @@ module.exports = class PkmnBackend { xxl, ...rest } = this.filter - const pokemon = this.id === 'global' ? undefined : [this.id] + if (pokemon === undefined && this.id !== 'global') pokemon = [this.id] if (this.mods.onlyLegacy) { return dnfifyIvFilter(adv, pokemon) }