dredless 0.5.1 → 0.5.2
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.
|
@@ -9478,7 +9478,7 @@
|
|
|
9478
9478
|
}
|
|
9479
9479
|
};
|
|
9480
9480
|
var ENTITY_SNAPSHOT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
9481
|
-
function
|
|
9481
|
+
function entitySnapshotFor(summary) {
|
|
9482
9482
|
if (!summary || typeof summary !== "object") return null;
|
|
9483
9483
|
let snapshot = ENTITY_SNAPSHOT_CACHE.get(summary);
|
|
9484
9484
|
if (!snapshot) {
|
|
@@ -9535,7 +9535,7 @@
|
|
|
9535
9535
|
return summariesFor(this.client, this.scope).map((summary) => new EntityHandle(this.client, summary.entity, this.scope));
|
|
9536
9536
|
}
|
|
9537
9537
|
snapshots() {
|
|
9538
|
-
return summariesFor(this.client, this.scope).map(
|
|
9538
|
+
return summariesFor(this.client, this.scope).map(entitySnapshotFor);
|
|
9539
9539
|
}
|
|
9540
9540
|
states() {
|
|
9541
9541
|
return this.snapshots();
|
|
@@ -9718,7 +9718,7 @@
|
|
|
9718
9718
|
const summary = worldStateFor(this.client, this.scope)?.entity(this.id) || null;
|
|
9719
9719
|
if (summary !== this._cachedSummary) {
|
|
9720
9720
|
this._cachedSummary = summary;
|
|
9721
|
-
this._cachedSnapshot =
|
|
9721
|
+
this._cachedSnapshot = entitySnapshotFor(summary);
|
|
9722
9722
|
}
|
|
9723
9723
|
return this._cachedSnapshot;
|
|
9724
9724
|
}
|
|
@@ -10414,7 +10414,8 @@
|
|
|
10414
10414
|
function currentPlayerSummary(client, scope = "current") {
|
|
10415
10415
|
const sid = Number(client?.sid);
|
|
10416
10416
|
if (!Number.isFinite(sid)) return null;
|
|
10417
|
-
|
|
10417
|
+
const players = worldStateFor(client, scope)?.model.players() || [];
|
|
10418
|
+
return players.find((player) => player.state?.q109) || null;
|
|
10418
10419
|
}
|
|
10419
10420
|
function currentPlayerRank(client) {
|
|
10420
10421
|
const player = currentPlayerSummary(client);
|