From 5ebc20510db78482af6749c819e2d40d043d4b7f Mon Sep 17 00:00:00 2001 From: Aurastic <33085835+ISenseAura@users.noreply.github.com> Date: Sun, 15 Mar 2026 12:00:30 +0530 Subject: [PATCH] Preact: Fix bug with forfeiting bo3 games (#2576) --- play.pokemonshowdown.com/src/client-main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/play.pokemonshowdown.com/src/client-main.ts b/play.pokemonshowdown.com/src/client-main.ts index 0c4965b0c..545cddaa3 100644 --- a/play.pokemonshowdown.com/src/client-main.ts +++ b/play.pokemonshowdown.com/src/client-main.ts @@ -1176,10 +1176,10 @@ export class PSRoom extends PSStreamModel implements RoomOptions { }, 'part,leave,close'(target, cmd, elem) { const roomid = (/[^a-z0-9-]/.test(target) ? toID(target) as any as RoomID : target as RoomID) || this.id; - const room = PS.rooms[roomid]; - const battle = (room as BattleRoom)?.battle; + const room = PS.rooms[roomid] as BattleRoom; + const battle = room?.battle; - if (room?.type === "battle" && !battle.ended && battle.mySide.id === PS.user.userid && !battle.isReplay) { + if (room?.type === "battle" && !battle.ended && room.users[PS.user.userid]?.startsWith('☆') && !battle.isReplay) { PS.join("forfeitbattle" as RoomID, { parentElem: elem }); return; }