Fix crash with stat change after Pokemon is recalled

pull/14/head
Flashfyre 2024-01-21 16:30:06 -05:00
parent 80095a64fc
commit c5eb86b0b1
3 changed files with 3 additions and 3 deletions

View File

@ -2151,7 +2151,7 @@ export class StatChangePhase extends PokemonPhase {
start() {
const pokemon = this.getPokemon();
if (pokemon.isFainted())
if (!pokemon.isActive(true))
return this.end();
const allStats = Utils.getEnumValues(BattleStat);

View File

@ -1601,7 +1601,7 @@ export class ProtectAttr extends AddBattlerTagAttr {
let timesUsed = 0;
const moveHistory = user.getLastXMoves();
let turnMove: TurnMove;
while (moveHistory.length && allMoves[(turnMove = moveHistory.shift()).move].getAttrs(ProtectAttr).find(pa => (pa as ProtectAttr).tagType === this.tagType) && turnMove.result === MoveResult.SUCCESS)
while (moveHistory.length && allMoves[(turnMove = moveHistory.shift()).move].getAttrs(ProtectAttr).find(pa => (pa as ProtectAttr).tagType === this.tagType))
timesUsed++;
if (timesUsed)
return !user.randSeedInt(Math.pow(2, timesUsed));

View File

@ -2413,7 +2413,7 @@ export const speciesStarters = {
[Species.SPIRITOMB]: 5,
[Species.GIBLE]: 4,
[Species.MUNCHLAX]: 4,
[Species.RIOLU]: 5,
[Species.RIOLU]: 4,
[Species.HIPPOPOTAS]: 3,
[Species.SKORUPI]: 3,
[Species.CROAGUNK]: 3,