mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
revert fix for Keldeo crashes + implement fix suggestion from PR #4619
This commit is contained in:
parent
d400dd93ab
commit
eea0f4b3ee
@ -2189,7 +2189,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.moveset.push(new PokemonMove(movePool[index][0], 0, 0));
|
this.moveset.push(new PokemonMove(movePool[index][0], 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeMoveLearnedTrigger);
|
// Trigger FormChange, except for enemy Pokemon during Mystery Encounters, to avoid crashes
|
||||||
|
if (this.isPlayer() || !this.scene.currentBattle.isBattleMysteryEncounter() || !this.scene.currentBattle.mysteryEncounter) {
|
||||||
|
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeMoveLearnedTrigger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trySelectMove(moveIndex: integer, ignorePp?: boolean): boolean {
|
trySelectMove(moveIndex: integer, ignorePp?: boolean): boolean {
|
||||||
|
@ -36,7 +36,6 @@ import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
|||||||
import { getGoldenBugNetSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { getGoldenBugNetSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
import { QuietFormChangePhase } from "#app/phases/quiet-form-change-phase";
|
|
||||||
|
|
||||||
export class EncounterPhase extends BattlePhase {
|
export class EncounterPhase extends BattlePhase {
|
||||||
private loaded: boolean;
|
private loaded: boolean;
|
||||||
@ -385,12 +384,6 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
encounter.onVisualsStart(this.scene);
|
encounter.onVisualsStart(this.scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear any lingering QuietFormChangePhases which can be inadvertently added by certain wild Pokemon forms
|
|
||||||
let phaseRemoved: boolean = true;
|
|
||||||
while (phaseRemoved) {
|
|
||||||
phaseRemoved = this.scene.tryRemoveUnshiftedPhase(phase => phase instanceof QuietFormChangePhase);
|
|
||||||
}
|
|
||||||
|
|
||||||
const doEncounter = () => {
|
const doEncounter = () => {
|
||||||
const doShowEncounterOptions = () => {
|
const doShowEncounterOptions = () => {
|
||||||
this.scene.ui.clearText();
|
this.scene.ui.clearText();
|
||||||
|
Loading…
Reference in New Issue
Block a user