Update src/phases/turn-start-phase.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Leo Kim 2024-09-21 18:52:55 +09:00 committed by GitHub
parent 7ef2dccadc
commit 3801395e72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,8 +50,8 @@ export class TurnStartPhase extends FieldPhase {
// Adjust the sort function based on whether Trick Room is active.
orderedTargets.sort((a: Pokemon, b: Pokemon) => {
const aSpeed = a?.getEffectiveStat(Stat.SPD) || 0;
const bSpeed = b?.getEffectiveStat(Stat.SPD) || 0;
const aSpeed = a?.getEffectiveStat(Stat.SPD) ?? 0;
const bSpeed = b?.getEffectiveStat(Stat.SPD) ?? 0;
return speedReversed.value ? aSpeed - bSpeed : bSpeed - aSpeed;
});