don't crash if a test faints a pokemon between CommandPhase and TurnStartPhase

This commit is contained in:
snoozbuster 2024-08-13 21:10:11 -07:00
parent d45ed3d9d3
commit 1b7ccb1912
1 changed files with 2 additions and 2 deletions

View File

@ -2372,8 +2372,8 @@ export class TurnStartPhase extends FieldPhase {
}
}
if (battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) {
return battlerBypassSpeed[a].value ? -1 : 1;
if (battlerBypassSpeed[a]?.value !== battlerBypassSpeed[b]?.value) {
return battlerBypassSpeed[a]?.value ? -1 : 1;
}
const aIndex = order.indexOf(a);