Properly clear timer in nextRequest

This commit is contained in:
Guangcong Luo 2019-08-07 13:27:45 -07:00
parent 91f81460cb
commit 5bd2c87190

View File

@ -256,7 +256,10 @@ class RoomBattleTimer {
return true;
}
nextRequest() {
if (this.timer) clearTimeout(this.timer);
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
if (!this.timerRequesters.size) return;
const players = this.battle.players;
if (players.some(player => player.secondsLeft <= 0)) return;