Skip to content

Commit

Permalink
Update battle-dex.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
KirbyRider1337 authored Apr 26, 2024
1 parent 66cf639 commit 2cd244f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions play.pokemonshowdown.com/src/battle-dex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,27 +488,30 @@ const Dex = new class implements ModdedDex {
}
}
if (reuseLocation && reuseLocation[optionsMod]) {
//console.log("Checking reuse in " + optionsMod + " for " + spriteId);
//console.log("Checking reuse in " + optionsMod + " for " + spriteId + " on " + filepath);
for (const prefix of ['ani', '']) {
if (reuseLocation[optionsMod].hasOwnProperty(prefix + filepath))
return {mod: optionsMod, inherit: reuseLocation[optionsMod][prefix + filepath]};
}
}
}
else if (!overrideStandard) { // for custom elements only, it will use sprites from another mod if the mod provided doesn't have one
if (!overrideStandard) { // for custom elements only, it will use sprites from another mod if the mod provided doesn't have one
for (const modName in window.ModSprites[spriteId]) {
if (window.ModSprites[spriteId] && window.ModSprites[spriteId][modName]) {
for (const prefix of ['', 'ani']) {
if (window.ModSprites[spriteId][modName].includes(prefix + filepath))
return {mod: modName, inherit: null};
}
}
if (reuseLocation && !pick.mod && reuseLocation[modName]) {
//console.log("Checking reuse in " + optionsMod + " for " + spriteId);

}
if (reuseLocation) {
for (const modName in reuseLocation) {
//console.log("Checking reuse in " + optionsMod + " for a replacement for " + spriteId + " on " + filepath);
for (const prefix of ['', 'ani']) {
const entry = reuseLocation[modName][prefix + filepath];
if (entry) {
pick = {mod: modName, inherit: entry};
return {mod: modName, inherit: entry};
break;
}
}
Expand Down

0 comments on commit 2cd244f

Please sign in to comment.