Filter self-referential campaign bonds

This commit is contained in:
2026-07-05 14:08:42 +09:00
parent 15df3532fb
commit 7196ab3dbd
2 changed files with 2 additions and 1 deletions

View File

@@ -286,6 +286,7 @@ try {
roster: { corrupted: true },
bonds: [
{ id: 'broken-bond', title: 'Broken Bond', unitIds: { corrupted: true }, level: 3, exp: 12, battleExp: 2 },
{ id: 'self-bond', title: 'Self Bond', unitIds: ['liu-bei', 'liu-bei'], level: 2, exp: 12, battleExp: 2 },
{ id: 'oath-bond', title: 'Oath Bond', unitIds: ['liu-bei', 'guan-yu'], level: '2', exp: '999', battleExp: '5' },
9
],

View File

@@ -1386,7 +1386,7 @@ function normalizeCampBondSnapshot(value: unknown): CampBondSnapshot | undefined
const unitIds = arrayOrEmpty<unknown>(value.unitIds).filter((unitId): unitId is string => typeof unitId === 'string' && unitId.length > 0);
const id = normalizeKeyString(value.id);
const title = normalizeDisplayString(value.title);
if (!id || !title || unitIds.length < 2) {
if (!id || !title || unitIds.length < 2 || unitIds[0] === unitIds[1]) {
return undefined;
}