Skip to content

Commit

Permalink
Data: Use dex.types.all() for Conversion 2 (#10612)
Browse files Browse the repository at this point in the history
Bugfix for gen8linked, optimization for base and gen8linked
  • Loading branch information
larry-the-table-guy authored Oct 13, 2024
1 parent 196b72a commit cb699be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions data/mods/gen8linked/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
if (!lastMove) return false;
const possibleTypes = [];
const attackType = lastMove.type;
for (const type in this.dex.data.TypeChart) {
if (source.hasType(type)) continue;
const typeCheck = this.dex.data.TypeChart[type].damageTaken[attackType];
for (const type of this.dex.types.all()) {
if (source.hasType(type.name)) continue;
const typeCheck = type.damageTaken[attackType];
if (typeCheck === 2 || typeCheck === 3) {
possibleTypes.push(type);
possibleTypes.push(type.name);
}
}
if (!possibleTypes.length) {
Expand Down
8 changes: 4 additions & 4 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2908,11 +2908,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
}
const possibleTypes = [];
const attackType = target.lastMoveUsed.type;
for (const type of this.dex.types.names()) {
if (source.hasType(type)) continue;
const typeCheck = this.dex.types.get(type).damageTaken[attackType];
for (const type of this.dex.types.all()) {
if (source.hasType(type.name)) continue;
const typeCheck = type.damageTaken[attackType];
if (typeCheck === 2 || typeCheck === 3) {
possibleTypes.push(type);
possibleTypes.push(type.name);
}
}
if (!possibleTypes.length) {
Expand Down

0 comments on commit cb699be

Please sign in to comment.