chore: don't splice quest stages when backtracking (#2961)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (push) Has been cancelled

Inbox messages and items likely should not be given again

Reviewed-on: #2961
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-11-01 02:51:46 -07:00 committed by Sainan
parent 5e6955ae32
commit 167da9c573

View File

@ -113,14 +113,10 @@ export const resetQuestKeyToStage = (
quest.Progress ??= [];
quest.Progress.splice(1 + ChainStage); // remove stages past the target
const questStage = quest.Progress[ChainStage];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (questStage) {
const run = quest.Progress[0].c;
if (run >= 0) {
questStage.c = run - 1;
const run = quest.Progress[0]?.c ?? 0;
if (run >= 0) {
for (let i = ChainStage; i < quest.Progress.length; ++i) {
quest.Progress[i].c = run - 1;
}
}
};