Preact: Do not show forfeit popup for instant replay (#2486)

This commit is contained in:
Aurastic 2025-07-30 17:00:14 +05:30 committed by GitHub
parent 99c3f00133
commit 5a83c5dd9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -1155,7 +1155,7 @@ export class PSRoom extends PSStreamModel<Args | null> implements RoomOptions {
const room = PS.rooms[roomid];
const battle = (room as BattleRoom)?.battle;
if (room?.type === "battle" && !battle.ended && battle.mySide.id === PS.user.userid) {
if (room?.type === "battle" && !battle.ended && battle.mySide.id === PS.user.userid && !battle.isReplay) {
PS.join("forfeitbattle" as RoomID, { parentElem: elem });
return;
}

View File

@ -438,6 +438,7 @@ export class ChatRoom extends PSRoom {
'play'() {
if (!this.battle) return this.add('|error|You are not in a battle');
if (this.battle.atQueueEnd) {
if (this.battle.ended) this.battle.isReplay = true;
this.battle.reset();
}
this.battle.play();