Protect against missing move entry

Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
This commit is contained in:
NightKev 2024-10-26 06:30:52 -07:00 committed by GitHub
parent 3e6f664155
commit 1cdaaa6bed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1421,7 +1421,7 @@ export class RecoilAttr extends MoveEffectAttr {
}
// Chloroblast and Struggle should not deal recoil damage if the move was not successful
if (this.useHp && [ MoveResult.FAIL, MoveResult.MISS ].includes(user.getLastXMoves(1)[0].result)) {
if (this.useHp && [ MoveResult.FAIL, MoveResult.MISS ].includes(user.getLastXMoves(1)[0]?.result)) {
return false;
}