From 8c21debc4499a470d4e65d16e308c0133141eed2 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 03:01:11 +0200 Subject: [PATCH] Update imports and add cloning functions in set-player-start-command.ts --- src/commands/set-player-start-command.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/set-player-start-command.ts b/src/commands/set-player-start-command.ts index 582f26fc..bcbcd7f0 100644 --- a/src/commands/set-player-start-command.ts +++ b/src/commands/set-player-start-command.ts @@ -1,7 +1,7 @@ -import type { EditorSelection } from "../core/selection"; +import { cloneEditorSelection, type EditorSelection } from "../core/selection"; import type { Vec3 } from "../core/vector"; import { createOpaqueId } from "../core/ids"; -import { createPlayerStartEntity } from "../entities/entity-instances"; +import { cloneEntityInstance, createPlayerStartEntity } from "../entities/entity-instances"; import type { EditorCommand } from "./command"; @@ -40,11 +40,11 @@ export function createSetPlayerStartCommand(options: SetPlayerStartCommandOption } if (previousSelection === null) { - previousSelection = context.getSelection().kind === "none" ? { kind: "none" } : structuredClone(context.getSelection()); + previousSelection = cloneEditorSelection(context.getSelection()); } if (previousEntity === null && currentEntity !== undefined) { - previousEntity = currentEntity; + previousEntity = cloneEntityInstance(currentEntity); } context.setDocument({