Fix crash with stat change after Pokemon is recalled

This commit is contained in:
Flashfyre committed 2024-01-21 16:30:06 -05:00
1 parent 80095a64fc
commit c5eb86b0b1
3 files changed
+3 -3

No files matched your search

+1 -1
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);
+1 -1
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));
+1 -1
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,