Skip to content

Commit

Permalink
Fix teambuilder move display for formes (#2258)
Browse files Browse the repository at this point in the history
* Fix teambuilder move display for formes

https://www.smogon.com/forums/threads/bug-report-teambuilder.3746541/
This bug was caused by my assumption that the client gets changesFrom the same way the server does.

* Update battle-dex-search.ts

Linter got upset
  • Loading branch information
dot-Comfey authored Jul 7, 2024
1 parent 0774605 commit 0b2844f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions play.pokemonshowdown.com/src/battle-dex-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1554,10 +1554,11 @@ class Species implements Effect {
this.canGigantamax = !!data.canGigantamax;
this.cannotDynamax = !!data.cannotDynamax;
this.forceTeraType = data.forceTeraType || '';
this.battleOnly = data.battleOnly || undefined;
this.battleOnly = data.battleOnly || (this.isMega ? this.baseSpecies : undefined);
this.isNonstandard = data.isNonstandard || null;
this.unreleasedHidden = data.unreleasedHidden || false;
this.changesFrom = data.changesFrom || undefined;
this.changesFrom = data.changesFrom ||
(this.battleOnly !== this.baseSpecies ? this.battleOnly : this.baseSpecies);
if (!this.gen) {
if (this.num >= 906 || this.formeid.startsWith('-paldea')) {
this.gen = 9;
Expand Down
3 changes: 2 additions & 1 deletion play.pokemonshowdown.com/src/battle-dex-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1603,7 +1603,8 @@ class BattleMoveSearch extends BattleTypedSearch<'move'> {
const originalSpecies = dex.species.get(species.id);
if (
currentSpecies.baseSpecies !== originalSpecies.baseSpecies && !originalSpecies.prevo &&
!originalSpecies.changesFrom && (!learnsetEntry.includes('e') || dex.gen !== 9)
(!originalSpecies.changesFrom || originalSpecies.name === "Greninja-Ash") &&
(!learnsetEntry.includes('e') || dex.gen !== 9)
) {
continue;
}
Expand Down

0 comments on commit 0b2844f

Please sign in to comment.