mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Preact: Fix bug with forfeiting bo3 games (#2576)
This commit is contained in:
parent
a0322536dd
commit
5ebc20510d
|
|
@ -1176,10 +1176,10 @@ export class PSRoom extends PSStreamModel<Args | null> 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user