@s2script/sdk 0.17.0 → 0.18.0

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.
Files changed (2) hide show
  1. package/entity.d.ts +9 -0
  2. package/package.json +1 -1
package/entity.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * NO runtime code: the engine injects the implementation at load time.
4
4
  */
5
5
 
6
+ import type { Vector } from "./math";
7
+
6
8
  /**
7
9
  * A host-liveness-gated handle to a live entity. `id` is a HOST-MINTED monotonic liveness
8
10
  * id — liveness is decided by the host's books (fed by engine create/delete notifications,
@@ -26,6 +28,13 @@ export declare class EntityRef {
26
28
  /** This entity's target (`CBaseEntity::m_target`) — the targetname of the entity it acts on, e.g. a
27
29
  * `func_button`'s target entity. `""` if the entity has no target; `null` if the ref is stale/invalid. */
28
30
  readonly target: string | null;
31
+ /** This entity's world-space position (`CGameSceneNode::m_vecAbsOrigin`, reached via
32
+ * `CBaseEntity::m_CBodyComponent` -> `CBodyComponent::m_pSceneNode`) — the same field CS2's
33
+ * `Pawn.origin` exposes for player pawns, readable here on any entity (e.g. ranking candidate
34
+ * `func_button`s by distance to a reference point). There is no meaningful "empty" position, so
35
+ * unlike {@link EntityRef.name}/{@link EntityRef.target}, `null` means exactly one thing: could not
36
+ * read (the ref is stale/invalid, or the field/chain didn't resolve) — never "no position". */
37
+ readonly origin: Vector | null;
29
38
  /** @internal The host mints refs; this is not part of the public API surface. */
30
39
  private constructor();
31
40
  /** True iff the host's books say live AND the identity slot still matches. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2script/sdk",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "description": "s2script SDK — the builtin capability types (imported as @s2script/sdk/entity, …) plus the `s2s` CLI for building Source 2 / CS2 plugins.",
6
6
  "type": "module",