Clamp campaign objective target markers

This commit is contained in:
2026-07-05 14:22:22 +09:00
parent e4ff46e6e0
commit c702bfdfb0
2 changed files with 16 additions and 4 deletions

View File

@@ -768,7 +768,15 @@ try {
status: 'lost',
detail: 12,
rewardGold: '80',
targetTile: { x: '4', y: '5', radius: '2' }
targetTile: { x: '4', y: '5', radius: '200' }
},
{
id: 'broken-target',
label: 'Broken target',
achieved: false,
detail: 'Bad target tile',
rewardGold: 0,
targetTile: { x: '-1', y: '5', radius: '2' }
},
'broken-objective',
...Array.from({ length: 30 }, (_, index) => ({
@@ -879,9 +887,12 @@ try {
`Expected stale latestBattleId to recover to the latest valid settlement: ${JSON.stringify(malformedHistory)}`
);
assert(
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives.length === 24 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives.length === 24 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[0].rewardGold === 80 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[0].targetTile?.x === 4 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[0].targetTile?.radius === 99 &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[1].id === 'broken-target' &&
malformedHistory.battleHistory['first-battle-zhuo-commandery']?.objectives[1].targetTile === undefined &&
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 &&