Fix crash with stat change after Pokemon is recalled
This commit is contained in:
1 parent
80095a64fc
commit
c5eb86b0b1
3 files changed
+3
-3
No files matched your search
+1
-1
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user