Skip to content

Conversation

@andrebastosdias
Copy link
Collaborator

@andrebastosdias andrebastosdias commented Jan 5, 2026

Fixes #11683
Client PR (it is very very small): smogon/pokemon-showdown-client#2590
Implements Mega Stones as megaStone?: { [megaEvolves: string]: string } for normalization purposes.
If for whatever reason we want to keep megaEvolves, it can be extracted directly from the keys of megaStone.

@Slayer95
Copy link
Collaborator

Slayer95 commented Jan 5, 2026

My only concern is that an attacker can send a Pokémon with species constructor to the validator, and this key could be looked up in places such as

if (item.megaStone?.[species.name]) {
species = this.dex.species.get(item.megaStone[species.name]);
typeTable = typeTable.filter(type => species.types.includes(type));

@KrisXV KrisXV merged commit 684150d into smogon:master Jan 8, 2026
1 check passed
@andrebastosdias andrebastosdias deleted the refactor-megastones branch January 8, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

megaEvolves property can have multiple types

3 participants