Validate sortie flow campaign routing

This commit is contained in:
2026-07-05 16:18:04 +09:00
parent e4e0e0779c
commit e8721aa4da

View File

@@ -41,6 +41,22 @@ for (const [flowKey, nextBattleId] of sortieFlowNextBattleIds.entries()) {
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()) {
const nextBattleId = sortieFlowNextBattleIds.get(battleId);
assert(battleIds.has(unlockBattleId), `Battle ${battleId} campaign reward unlocks unknown battle id: ${unlockBattleId}`);