don't crash if a test faints a pokemon between CommandPhase and TurnStartPhase
This commit is contained in:
parent
d45ed3d9d3
commit
1b7ccb1912
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue