Reject stale battle save attack intents

This commit is contained in:
2026-07-05 14:01:33 +09:00
parent 11e42fd54f
commit 4d2a311891
2 changed files with 18 additions and 4 deletions

View File

@@ -54,6 +54,8 @@ try {
['unknown attack intent unit id', { attackIntents: [{ attackerId: 'liu-bei', targetId: 'ghost-unit' }] }],
['self-targeting attack intent', { attackIntents: [{ attackerId: 'liu-bei', targetId: 'liu-bei' }] }],
['duplicate attack intent attacker id', { attackIntents: [{ attackerId: 'liu-bei', targetId: 'rebel-1' }, { attackerId: 'liu-bei', targetId: 'rebel-1' }] }],
['defeated attack intent attacker', { units: patchUnit(0, { hp: 0 }) }],
['defeated attack intent target', { units: patchUnit(2, { hp: 0 }) }],
['invalid units array', { units: {} }],
['too high unit level', { units: patchUnit(0, { level: 100, exp: 0 }) }],
['invalid unit exp threshold', { units: patchUnit(0, { exp: 100 }) }],