From 96abd838a43bd9d8d53242ef31e66553cf12a114 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Wed, 27 May 2026 15:44:47 -0700 Subject: [PATCH] Sort party select: conscious Pokemon first, then fainted, most recent within each group --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index 9b40d96..51bce19 100644 --- a/game.js +++ b/game.js @@ -686,7 +686,7 @@ class Game { const list = document.getElementById('party-select-list'); list.innerHTML = ''; - const ordered = [...this.state.party].reverse(); + const ordered = [...this.state.party].reverse().sort((a, b) => (a.fainted ? 1 : 0) - (b.fainted ? 1 : 0)); ordered.forEach((poke, i) => { const entry = document.createElement('div');