Skip to content

Commit

Permalink
Always show OTS to spectators
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Dec 19, 2024
1 parent 9d255d0 commit 9bed1d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion data/rulesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
}
},
onTeamPreview() {
this.showOpenTeamSheets(this.rated === true);
this.showOpenTeamSheets();
},
},
aaarestrictedabilities: {
Expand Down
2 changes: 1 addition & 1 deletion sim/battle-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class BattleStream extends Streams.ObjectReadWriteStream<string> {
this.push(`requesteddata\n${team}`);
break;
case 'show-openteamsheets':
this.battle!.showOpenTeamSheets(this.battle!.rated === true);
this.battle!.showOpenTeamSheets();
break;
case 'version':
case 'version-origin':
Expand Down
11 changes: 3 additions & 8 deletions sim/battle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3017,7 +3017,7 @@ export class Battle {
return team as PokemonSet[];
}

showOpenTeamSheets(hideFromSpectators = false) {
showOpenTeamSheets() {
if (this.turn !== 0) return;
for (const side of this.sides) {
const team = side.pokemon.map(pokemon => {
Expand Down Expand Up @@ -3054,13 +3054,8 @@ export class Battle {
}
return newSet;
});
if (hideFromSpectators) {
for (const s of this.sides) {
this.addSplit(s.id, ['showteam', side.id, Teams.pack(team)]);
}
} else {
this.add('showteam', side.id, Teams.pack(team));
}

this.add('showteam', side.id, Teams.pack(team));
}
}

Expand Down

0 comments on commit 9bed1d7

Please sign in to comment.