Require valid campaign save for continue

This commit is contained in:
2026-07-05 11:02:21 +09:00
parent 1943363111
commit 5c9983b2d7
2 changed files with 4 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ try {
applyCampBondExp,
applyCampVisitReward,
getCampaignState,
hasCampaignSave,
loadCampaignState,
normalizeCampaignSortieItemAssignments,
resetCampaignState,
@@ -660,6 +661,7 @@ try {
storage.set(campaignStorageKey, JSON.stringify({ version: 99, step: 'sixty-sixth-camp' }));
const unsupported = loadCampaignState();
assert(unsupported.step === 'new', `Expected unsupported future save version to be ignored: ${JSON.stringify(unsupported)}`);
assert(!hasCampaignSave(), 'Expected unsupported base save without valid slots to be ignored by hasCampaignSave');
storage.clear();
storage.set(campaignStorageKey, JSON.stringify({ version: 99, step: 'sixty-sixth-camp' }));
@@ -673,6 +675,7 @@ try {
gold: 260
})
);
assert(hasCampaignSave(), 'Expected valid slotted save fallback to be visible to hasCampaignSave');
const fallback = loadCampaignState();
assert(fallback.step === 'second-camp' && fallback.activeSaveSlot === 2, `Expected valid slotted save fallback: ${JSON.stringify(fallback)}`);