mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 19:34:01 +00:00
fix(agent): age World Packet feeds against the clock for non-finite now
A default parameter only covers undefined, so now: null aged every feed against the epoch and reported stale data as just now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4ecbe54997
commit
0f237a32d4
1 file changed
+4
-1
@@ -99,8 +99,11 @@ export function getWorldPacket(options = {}) {
|
|||||||
styleManager,
|
styleManager,
|
||||||
dataManager,
|
dataManager,
|
||||||
sceneDirector = null,
|
sceneDirector = null,
|
||||||
now = Date.now(),
|
now: requestedNow,
|
||||||
} = options ?? {};
|
} = options ?? {};
|
||||||
|
// A default parameter only covers undefined; null or NaN would age every
|
||||||
|
// feed against the epoch and report stale data as "just now".
|
||||||
|
const now = Number.isFinite(requestedNow) ? requestedNow : Date.now();
|
||||||
if (!viewer?.camera?.positionWC)
|
if (!viewer?.camera?.positionWC)
|
||||||
throw new TypeError('World Packet requires a viewer camera');
|
throw new TypeError('World Packet requires a viewer camera');
|
||||||
if (!dataManager || typeof dataManager.getAll !== 'function')
|
if (!dataManager || typeof dataManager.getAll !== 'function')
|
||||||
|
|||||||
Reference in new issue
Block a user