diff --git a/extension/chrome/manifest.json b/extension/chrome/manifest.json index 2cff9d0d..9620f083 100644 --- a/extension/chrome/manifest.json +++ b/extension/chrome/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Pokémon Showdown Randbats Tooltip", "description": "Enhanced tooltip functionality for Pokémon Showdown Random Battle formats.", - "version": "1.4.0", + "version": "1.4.1", "icons": { "16": "/16x16.png", "32": "/32x32.png", diff --git a/extension/firefox/manifest.json b/extension/firefox/manifest.json index 2fb0b590..a98b0ae2 100644 --- a/extension/firefox/manifest.json +++ b/extension/firefox/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Pokémon Showdown Randbats Tooltip", "description": "Enhanced tooltip functionality for Pokémon Showdown Random Battle formats.", - "version": "1.4.0", + "version": "1.4.1", "icons": { "16": "/16x16.png", "32": "/32x32.png", diff --git a/extension/index.js b/extension/index.js index bbe06fbf..f492159e 100644 --- a/extension/index.js +++ b/extension/index.js @@ -27,6 +27,7 @@ if (TOOLTIP) { for (var name in json) { var pokemon = json[name]; data[pokemon.level] = data[pokemon.level] || {}; + // Dex.forGen not important here because we're not looking at stats var species = Dex.species.get(name); var id = toID(species.forme === 'Gmax' ? species.baseSpecies @@ -52,16 +53,16 @@ if (TOOLTIP) { var format = toID(this.battle.tier); if (!format || !format.includes('random')) return original; - var species = Dex.species.get( + var gen = Number(format.charAt(3)); + var letsgo = format.includes('letsgo'); + var gameType = this.battle.gameType; + + var species = Dex.forGen(gen).species.get( clientPokemon.volatiles.formechange ? clientPokemon.volatiles.formechange[1] : clientPokemon.speciesForme); if (!species) return original; - var gen = Number(format.charAt(3)); - var letsgo = format.includes('letsgo'); - var gameType = this.battle.gameType; - if (!['singles', 'doubles'].includes(gameType)) { format = 'gen' + gen + 'randomdoublesbattle'; } else if (format.includes('monotype') || format.includes('unrated')) {