spoint 0.1.680 → 0.1.681

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/client/app.js +9 -1
  2. package/package.json +1 -1
package/client/app.js CHANGED
@@ -2422,7 +2422,15 @@ function startInputLoop() {
2422
2422
  ams.dispatchInput(sendInput,engineCtx); client.sendInput(sendInput)
2423
2423
  }, 1000/60)
2424
2424
  }
2425
- renderer.domElement.addEventListener('click', ()=>{ if (inputConfig.pointerLock&&!document.pointerLockElement) renderer.domElement.requestPointerLock() })
2425
+ renderer.domElement.addEventListener('click', ()=>{
2426
+ if (!inputConfig.pointerLock || document.pointerLockElement) return
2427
+ // requestPointerLock() can throw synchronously (not just reject) in some browser/automation
2428
+ // contexts -- e.g. "The root document of this element is not valid for pointer lock" when the
2429
+ // element's document isn't the active top-level document at click time. Left unguarded this was
2430
+ // an uncaught exception that tripped the app's global error boundary, converting a benign
2431
+ // lock-denial into a full page crash. The keydown fallback below still recovers gameplay either way.
2432
+ try { renderer.domElement.requestPointerLock() } catch (e) { console.warn('[input] requestPointerLock failed:', e?.message || e) }
2433
+ })
2426
2434
  // requestPointerLock() is a trusted-gesture-gated browser API that can silently reject (denied
2427
2435
  // engagement heuristic, automation-driven click, embedded/iframe context) with no visible error --
2428
2436
  // the click-prompt overlay then never dismisses and gameplay looks permanently blocked even though
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spoint",
3
- "version": "0.1.680",
3
+ "version": "0.1.681",
4
4
  "description": "Physics and netcode SDK for multiplayer game servers",
5
5
  "type": "module",
6
6
  "workspaces": [