Fix errors due to removed glyph filter info

This commit is contained in:
SpectralFlame 2023-05-08 13:00:31 -05:00 committed by cyip92
parent f8b33a5e36
commit 8f0573f1e3
2 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,7 @@ export const AutoGlyphProcessor = {
// on only the glyph itself and not external factors.
filterValue(glyph) {
const typeCfg = this.types[glyph.type];
if (glyph.type === "companion") return Infinity;
if (["companion", "reality"].includes(glyph.type)) return Infinity;
if (glyph.type === "cursed") return -Infinity;
switch (this.scoreMode) {
case AUTO_GLYPH_SCORE.LOWEST_SACRIFICE:
@ -79,6 +79,9 @@ export const AutoGlyphProcessor = {
},
// This is a mode-specific threshold which determines if selected glyphs are "good enough" to keep
thresholdValue(glyph) {
// Glyph filter settings are undefined for companion/cursed/reality glyphs, so we return the lowest possible
// value on the basis that we never want to automatically get rid of them
if (this.types[glyph.type] === undefined) return -Number.MAX_VALUE;
switch (this.scoreMode) {
case AUTO_GLYPH_SCORE.EFFECT_COUNT:
return player.reality.glyphs.filter.simple;

View File

@ -290,6 +290,8 @@ GameStorage.migrations = {
// old filter data into the new prop
const reducedFilter = {};
const effectDB = Object.values(GameDatabase.reality.glyphEffects);
// The in-dev filter had entries for companion/reality/cursed glyphs, which have been removed and any other errors
// which show up elsewhere have been resolved
for (const type of ALCHEMY_BASIC_GLYPH_TYPES) {
const oldData = player.celestials.effarig.glyphScoreSettings.types[type];
const typeEffects = effectDB.filter(t => t.glyphTypes.includes(type)).map(t => t.id);