Deduplicate campaign reward references

This commit is contained in:
2026-07-05 14:13:27 +09:00
parent 7196ab3dbd
commit d0085eeb18
2 changed files with 38 additions and 14 deletions

View File

@@ -649,11 +649,13 @@ try {
reputation: ['Village Thanks', ' Village Thanks '],
recruits: [
{ unitId: ' guan-yu ', name: ' Guan Yu ' },
{ unitId: 'guan-yu', name: 'Duplicate Guan Yu' },
{ unitId: '', name: 'Broken' },
...Array.from({ length: 140 }, (_, index) => ({ unitId: `recruit-${index}`, name: `Recruit ${index}` }))
],
unlocks: [
{ battleId: ' second-battle-yellow-turban-pursuit ', title: ' Next ' },
{ battleId: 'second-battle-yellow-turban-pursuit', title: 'Duplicate Next' },
{ battleId: '', title: 'Broken' },
...Array.from({ length: 140 }, (_, index) => ({ battleId: `battle-${index}`, title: `Battle ${index}` }))
],
@@ -690,8 +692,12 @@ try {
malformedReport.firstBattleReport.campaignRewards?.reputation.length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.recruits.length === 128 &&
malformedReport.firstBattleReport.campaignRewards?.recruits[0].unitId === 'guan-yu' &&
malformedReport.firstBattleReport.campaignRewards?.recruits[0].name === 'Guan Yu' &&
malformedReport.firstBattleReport.campaignRewards?.recruits.filter((recruit) => recruit.unitId === 'guan-yu').length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.unlocks.length === 128 &&
malformedReport.firstBattleReport.campaignRewards?.unlocks[0].battleId === 'second-battle-yellow-turban-pursuit' &&
malformedReport.firstBattleReport.campaignRewards?.unlocks[0].title === 'Next' &&
malformedReport.firstBattleReport.campaignRewards?.unlocks.filter((unlock) => unlock.battleId === 'second-battle-yellow-turban-pursuit').length === 1 &&
malformedReport.firstBattleReport.campaignRewards?.note === 'Reward note' &&
malformedReport.firstBattleReport.completedCampDialogues.length === 1 &&
malformedReport.firstBattleReport.completedCampVisits.length === 0,