From 7e77d8efd080990fc742665f152dd259d0d65b6c Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 24 May 2020 18:17:24 +0000 Subject: [PATCH] Limit the maximum number of physics iterations in a frame to 32 to match engine's CL_MAX_USERCMDS, possible fix for the casing disconnect issue --- qcsrc/common/physics/movetypes/movetypes.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 63aa3dd95..7894d14fd 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -747,7 +747,7 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy) // SV_Ph float dt = time - this.move_time; - int n = max(0, floor(dt / tr)); + int n = bound(0, floor(dt / tr), 32); // limit the number of frames to 32 (CL_MAX_USERCMDS, using DP_SMALLMEMORY value for consideration of QC's limitations) dt -= n * tr; this.move_time += n * tr; -- 2.39.2