add id to BattleReplay

This commit is contained in:
taDuc
2026-05-17 22:01:09 +07:00
parent 047f662736
commit c09928a2b2
7 changed files with 23 additions and 1 deletions
@@ -716,6 +716,7 @@ function createReplaySessionSeed(
selectedIds: (string | number)[]
): BattleReplay {
return {
id: geometryId,
geometry_id: geometryId,
target_geometry_ids: buildReplaySeedTargetIds(
sourceDraft.features.find((feature) => String(feature.properties.id) === geometryId),
@@ -733,6 +734,7 @@ function normalizeReplaySessionSeed(
selectedIds: (string | number)[]
): BattleReplay {
const nextReplay = deepClone(replay);
nextReplay.id = geometryId;
const triggerFeature = sourceDraft.features.find((feature) => String(feature.properties.id) === geometryId);
const seedTargetIds = buildReplaySeedTargetIds(triggerFeature, geometryId, selectedIds);
nextReplay.target_geometry_ids = normalizeReplayTargetGeometryIds(