Filter self-referential campaign bonds
This commit is contained in:
@@ -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
|
||||
],
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user