Recover malformed settlement equipment
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user