Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always show OTS to spectators #10767

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... I guess these hunks can always be reverted if you need to change the setting in future for any reason...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is for VGC only, I'm not terribly worried about dropping it. Improves performance by 0.0001 seconds or whatever by not having to check the if statement.

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
Loading