Skip to content

Commit

Permalink
CGT: Track wins/losses for level 100 Pokemon (#10909)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyuk-bot authored Feb 16, 2025
1 parent 08fe70e commit 9f58961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/chat-plugins/cg-teams-leveling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function updateStats(battle: RoomBattle, winner: ID) {
if (!incrementWins || !incrementLosses) await dbSetupPromise;
if (toID(battle.format) !== 'gen9computergeneratedteams') return;
// if the game is rated or part of a tournament hosted by a public room, it counts
if (battle.rated === 1 && battle.room.parent?.game) {
if (battle.rated <= 1 && battle.room.parent?.game) {
let parent = battle.room.parent;
if (parent.game!.gameid === 'bestof' && parent.parent?.game) parent = parent.parent;
if (parent.game!.gameid !== 'tournament' || parent.settings.isPrivate) return;
Expand All @@ -56,7 +56,7 @@ async function updateStats(battle: RoomBattle, winner: ID) {

for (const set of team) {
const statsSpecies = getLevelSpeciesID(set, Dex.formats.get(battle.format));
await addPokemon?.run([statsSpecies, set.level]);
await addPokemon?.run([statsSpecies, set.level || 100]);
await increment?.run([statsSpecies]);
}
}
Expand Down

0 comments on commit 9f58961

Please sign in to comment.