mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-09 09:45:44 -05:00
Fix crash in Bio Mech Mons
This commit is contained in:
@@ -1213,7 +1213,12 @@ export const Formats: import('../sim/dex-formats').FormatList = [
|
||||
if (species.requiredItems) requiredItems = species.requiredItems;
|
||||
if (species.requiredMove) requiredMove = species.requiredMove;
|
||||
if (species.requiredAbility) requiredAbility = species.requiredAbility;
|
||||
if (species.battleOnly) species = dex.species.get(species.battleOnly as string);
|
||||
if (species.battleOnly) {
|
||||
if (typeof species.battleOnly !== 'string') {
|
||||
return this.validateForme(set) || [`${species.name} does not start the battle in that forme.`];
|
||||
}
|
||||
species = dex.species.get(species.battleOnly);
|
||||
}
|
||||
|
||||
const effectFunctions = [dex.abilities, dex.items, dex.moves];
|
||||
if (
|
||||
|
||||
@@ -2786,8 +2786,13 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
||||
if (species.requiredMove && !set.moves.map(this.toID).includes(this.toID(species.requiredMove))) {
|
||||
return [`${set.name ? `${set.name} (${species.name})` : species.name} is required to have ${species.requiredMove}.`];
|
||||
}
|
||||
set.species = (species.id === 'xerneas' ? 'Xerneas-Neutral' :
|
||||
species.id === 'zygardecomplete' ? 'Zygarde' : species.battleOnly) as string;
|
||||
set.species = (
|
||||
species.id === 'xerneas' ? 'Xerneas-Neutral' :
|
||||
typeof species.battleOnly === 'string' ? species.battleOnly :
|
||||
species.battleOnly ? species.battleOnly[0] :
|
||||
// should never happen?
|
||||
set.species
|
||||
);
|
||||
species = this.dex.species.get(set.species);
|
||||
}
|
||||
for (const moveid of set.moves) {
|
||||
|
||||
Reference in New Issue
Block a user