Commit graph

3 commits

Author SHA1 Message Date
a8bfa738b0 Fix seeking: snapshot timing, backwards time, entity cleanup
Server:
- Reset nextSnapshotTime for active clients after seek so
  SV_SendClientMessages doesn't skip sending (was comparing
  future nextSnapshotTime against past svs.time)
- First frame always a keyframe (beginning seekable)
- Keyframes during normal playback only reset delta state,
  no SNAPFLAG_RESET_ENTITIES (no visual glitch every 5 sec)

Engine client:
- Reset cl.oldFrameServerTime on SERVERCOUNT toggle to prevent
  "time went backwards" error in CL_SetCGameTime

cgame:
- Handle backwards time in CG_ProcessSnapshots for demo seek:
  accept the time jump, reset cg.time, clear all entity state
  (currentValid, interpolate, time-dependent fields), clear
  local entities (particles, gibs, smoke), wait for next snapshot
- Prevents CG_InterpolateEntityPosition NULL nextSnap error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:31:47 +08:00
490fcd9bde Smooth unpause: reset client time delta and entity interpolation
On unpause, toggle SNAPFLAG_SERVERCOUNT and set SNAPFLAG_RESET_ENTITIES.
In CL_ParseSnapshot, detect SERVERCOUNT toggle and hard-reset
cl.serverTimeDelta instead of letting CL_AdjustTimeDelta slowly drift.
During pause, the delta drifted because snapshots had frozen serverTime
while cls.realtime advanced. Without the hard reset, it took 1-2 seconds
of choppy interpolation to re-sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 03:59:44 +08:00
Sergei Shubin
4c57221941 Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00