updateQuestStage seems to have been correct
This commit is contained in:
parent
184407d6f0
commit
869d4915bb
@ -63,13 +63,13 @@ export const updateQuestStage = (
|
||||
throw new Error(`Progress should always exist when giving keychain triggered items or messages`);
|
||||
}
|
||||
|
||||
const questStage = quest.Progress[ChainStage - 1];
|
||||
const questStage = quest.Progress[ChainStage];
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (!questStage) {
|
||||
const questStageIndex = quest.Progress.push(questStageUpdate) - 1;
|
||||
if (questStageIndex !== ChainStage - 1) {
|
||||
throw new Error(`Quest stage index mismatch: ${questStageIndex} !== ${ChainStage - 1}`);
|
||||
if (questStageIndex !== ChainStage) {
|
||||
throw new Error(`Quest stage index mismatch: ${questStageIndex} !== ${ChainStage}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user