mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-30 04:02:51 +01:00
Check banner if exists
This commit is contained in:
parent
b438f5fbaf
commit
3ae3ae995c
1 changed files with 17 additions and 12 deletions
|
@ -411,7 +411,7 @@
|
||||||
|
|
||||||
const path = `wish-counter-${type.id}`;
|
const path = `wish-counter-${type.id}`;
|
||||||
const localData = await readSave(`${prefix}${path}`);
|
const localData = await readSave(`${prefix}${path}`);
|
||||||
const withRate = type.id === 'character-event' || type.id === 'weapon-event';
|
let withRate = type.id === 'character-event' || type.id === 'weapon-event';
|
||||||
|
|
||||||
let localWishes = [];
|
let localWishes = [];
|
||||||
if (localData !== null) {
|
if (localData !== null) {
|
||||||
|
@ -465,20 +465,25 @@
|
||||||
rarity = weaponList[combined[i].id].rarity;
|
rarity = weaponList[combined[i].id].rarity;
|
||||||
}
|
}
|
||||||
|
|
||||||
const unixTime = dayjs(combined[i].time).unix();
|
try {
|
||||||
if (withRate && (currentSelectedBanner === null || currentSelectedBanner.end < unixTime)) {
|
const unixTime = dayjs(combined[i].time).unix();
|
||||||
lastBannerIndex = currentBannerIndex;
|
if (withRate && (currentSelectedBanner === null || currentSelectedBanner.end < unixTime)) {
|
||||||
|
lastBannerIndex = currentBannerIndex;
|
||||||
|
|
||||||
const nextBanner = getNextBanner(unixTime);
|
const nextBanner = getNextBanner(unixTime);
|
||||||
|
|
||||||
if (nextBanner === undefined) {
|
if (nextBanner === undefined) {
|
||||||
currentBannerIndex = lastBannerIndex;
|
currentBannerIndex = lastBannerIndex;
|
||||||
currentSelectedBanner = lastBanner;
|
currentSelectedBanner = lastBanner;
|
||||||
} else {
|
} else {
|
||||||
currentSelectedBanner = nextBanner.selectedBanner;
|
currentSelectedBanner = nextBanner.selectedBanner;
|
||||||
currentBannerIndex = nextBanner.currentBannerIndex;
|
currentBannerIndex = nextBanner.currentBannerIndex;
|
||||||
lastBanner = currentSelectedBanner;
|
lastBanner = currentSelectedBanner;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
withRate = false;
|
||||||
|
console.log('ERROR PARSE BANNER', combined[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// guaranteed + winrateoff
|
// guaranteed + winrateoff
|
||||||
|
|
Loading…
Reference in a new issue