From 676527a02118d4142f9a764366f2fd462fdde630 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Tue, 30 Mar 2021 16:11:38 +0000 Subject: [PATCH] sv_user: Don't bound moveframetime to a multiple of frametime when frametime is zero Fixes https://gitlab.com/xonotic/darkplaces/-/issues/347 From bones_was_here git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13106 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sv_user.c b/sv_user.c index 9395be62..11354a14 100644 --- a/sv_user.c +++ b/sv_user.c @@ -811,7 +811,8 @@ static void SV_ExecuteClientMoves(void) move->time = bound(sv.time - 1, move->time, sv.time); // prevent slowhack/speedhack combos move->time = max(move->time, host_client->cmd.time); // prevent backstepping of time // bones_was_here: limit moveframetime to a multiple of sv.frametime to match inputtimeout behaviour - moveframetime = min(move->time - host_client->cmd.time, min(0.1, sys_ticrate.value > 0.0 ? sv.frametime * ceil(sv_clmovement_inputtimeout.value / sv.frametime) : sv_clmovement_inputtimeout.value)); + moveframetime = min(move->time - host_client->cmd.time, min(0.1, sys_ticrate.value > 0.0 && sv.frametime ? sv.frametime * ceil(sv_clmovement_inputtimeout.value / sv.frametime) : sv_clmovement_inputtimeout.value)); + // discard (treat like lost) moves with too low distance from // the previous one to prevent hacks using float inaccuracy -- 2.39.2