Sort party select: conscious Pokemon first, then fainted, most recent within each group
This commit is contained in:
1 parent
5e74d5f677
commit
96abd838a4
1 file changed
+1
-1
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user