Validate sortie flow campaign routing
This commit is contained in:
@@ -41,6 +41,22 @@ for (const [flowKey, nextBattleId] of sortieFlowNextBattleIds.entries()) {
|
|||||||
assert(battleIds.has(nextBattleId), `Sortie flow ${flowKey} references unknown next battle id: ${nextBattleId}`);
|
assert(battleIds.has(nextBattleId), `Sortie flow ${flowKey} references unknown next battle id: ${nextBattleId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const flowKey of sortieFlowKeys) {
|
||||||
|
const nextBattleId = sortieFlowNextBattleIds.get(flowKey);
|
||||||
|
const campaignStep = sortieFlowCampaignSteps.get(flowKey);
|
||||||
|
if (!nextBattleId) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(campaignStep, `Sortie flow ${flowKey} has next battle ${nextBattleId} but no campaign step`);
|
||||||
|
if (campaignStep) {
|
||||||
|
assert(
|
||||||
|
routedBattleSteps.get(campaignStep) === nextBattleId,
|
||||||
|
`Sortie flow ${flowKey} marks campaign step ${campaignStep} but routes to ${routedBattleSteps.get(campaignStep) ?? 'no battle'} instead of ${nextBattleId}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const [battleId, unlockBattleId] of campaignRewardUnlockBattleIds.entries()) {
|
for (const [battleId, unlockBattleId] of campaignRewardUnlockBattleIds.entries()) {
|
||||||
const nextBattleId = sortieFlowNextBattleIds.get(battleId);
|
const nextBattleId = sortieFlowNextBattleIds.get(battleId);
|
||||||
assert(battleIds.has(unlockBattleId), `Battle ${battleId} campaign reward unlocks unknown battle id: ${unlockBattleId}`);
|
assert(battleIds.has(unlockBattleId), `Battle ${battleId} campaign reward unlocks unknown battle id: ${unlockBattleId}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user