Recover malformed settlement equipment

This commit is contained in:
2026-07-05 10:10:22 +09:00
parent 7cd7f4b8c9
commit 23eabd9ca6
2 changed files with 6 additions and 3 deletions

View File

@@ -412,6 +412,9 @@ try {
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[0].status === undefined &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.units.length === 1 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.units[0].level === 4 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.units[0].equipment.weapon.itemId === 'training-sword' &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.units[0].equipment.armor.itemId === 'cloth-armor' &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.units[0].equipment.accessory.itemId === 'grain-pouch' &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.bonds.length === 1 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.bonds[0].battleExp === 4 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.reserveTraining?.length === 1 &&

View File

@@ -982,11 +982,11 @@ function normalizeCampaignUnitProgressSnapshot(value: unknown): CampaignUnitProg
return {
unitId: value.unitId,
name: value.name,
level: normalizeNonNegativeInteger(value.level),
level: Math.max(1, normalizeNonNegativeInteger(value.level)),
exp: normalizeNonNegativeInteger(value.exp),
hp,
maxHp,
equipment: recordOrEmpty(value.equipment) as UnitData['equipment']
maxHp: Math.max(1, maxHp),
equipment: normalizeEquipmentSet(value.equipment)
};
}