castle-web-cli 0.4.158 → 0.4.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  <link rel="icon" type="image/png" sizes="32x32" href="/__castle/ide/favicon-32x32.png" />
11
11
  <link rel="icon" type="image/png" sizes="16x16" href="/__castle/ide/favicon-16x16.png" />
12
12
  <link rel="icon" href="/__castle/ide/favicon.ico" sizes="any" />
13
- <script type="module" crossorigin src="/__castle/ide/assets/index-BuSYLy-C.js"></script>
13
+ <script type="module" crossorigin src="/__castle/ide/assets/index-DMSoTyXh.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/__castle/ide/assets/index-DfZmu3XC.css">
15
15
  </head>
16
16
  <body>
@@ -35,5 +35,5 @@
35
35
  },
36
36
  "deckId": "oiFu96LkwZ09",
37
37
  "cardId": "nkJgrvrCby3H",
38
- "publishedVersion": "2026-09-02T03:33:41.146Z"
38
+ "publishedVersion": "2026-09-02T03:58:28.670Z"
39
39
  }
@@ -8,6 +8,19 @@ import { applyCharacterPose } from './poses.js';
8
8
  // The blueprint spawned when the caller names none.
9
9
  const BLUEPRINT = 'blueprints/other-player.scene';
10
10
 
11
+ // Where that blueprint sits depends on who is running: the kit played on its own
12
+ // has it at the deck root, and a deck that imports the kit has it under
13
+ // `imports/<alias>/`. `spawnFromBlueprint` resolves a bare path against the deck
14
+ // root, so an importing deck would find no template and spawn an actor with no
15
+ // Box -- an invisible other player. Match on the path suffix instead.
16
+ function defaultBlueprint(scene) {
17
+ const files = scene.files ?? {};
18
+ if (files[BLUEPRINT]) {
19
+ return BLUEPRINT;
20
+ }
21
+ return Object.keys(files).find((path) => path.endsWith(`/${BLUEPRINT}`)) ?? BLUEPRINT;
22
+ }
23
+
11
24
  // Create the player-to-actor index held by one multiplayer system instance.
12
25
  export function makeAvatars() {
13
26
  // Actor ids remain valid across frames and can be resolved through the scene.
@@ -18,7 +31,8 @@ export function makeAvatars() {
18
31
  // system calls this once per other player per frame with the smoothed network
19
32
  // pose. A `username` of null draws no label.
20
33
  export function showPlayer(avatars, scene, playerId, username, pose, options = {}) {
21
- const actor = ensureActor(avatars, scene, playerId, pose, options.blueprint ?? BLUEPRINT);
34
+ const blueprint = options.blueprint ?? defaultBlueprint(scene);
35
+ const actor = ensureActor(avatars, scene, playerId, pose, blueprint);
22
36
 
23
37
  // Network character poses update Layout and Box facing on the spawned actor.
24
38
  applyCharacterPose(actor, pose);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "castle-web-cli",
3
- "version": "0.4.158",
3
+ "version": "0.4.159",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "castle-web": "./dist/index.js"