Skip to content

Commit

Permalink
Support rematching with custom rules (#2234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 authored Apr 3, 2024
1 parent 8411650 commit ae907b5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions play.pokemonshowdown.com/js/client-battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -1243,10 +1243,17 @@
app.focusRoom('');
},
closeAndRematch: function () {
app.rooms[''].requestNotifications();
app.rooms[''].challenge(this.battle.farSide.name, this.battle.tier);
this.close();
app.focusRoom('');
app.once('response:fullformat', function (data) {
app.rooms[''].requestNotifications();
if (data) {
app.rooms[''].challenge(this.battle.farSide.name, data);
} else {
app.rooms[''].challenge(this.battle.farSide.name, this.battle.tier);
}
this.close();
app.focusRoom('');
}, this);
app.send('/cmd fullformat ' + this.id);
},

// choice buttons
Expand Down

0 comments on commit ae907b5

Please sign in to comment.