X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=sv_user.c;h=ff1bdbc3b6ab0f8d742e3ffb321266b4a867759b;hb=73f27d62983b6af1cb9a6971d0a4cb6275b91a07;hp=9395be62acf37d7fea8d4e6a0fe97010530e55e3;hpb=0eb36dc61506a11e8d90a7ea7722bb029d6fc724;p=xonotic%2Fdarkplaces.git diff --git a/sv_user.c b/sv_user.c index 9395be62..ff1bdbc3 100644 --- a/sv_user.c +++ b/sv_user.c @@ -718,7 +718,7 @@ static void SV_ReadClientMove (void) } // as requested by FrikaC, cursor_trace_ent is reset to world if the // entity is free at time of receipt - if (PRVM_EDICT_NUM(move->cursor_entitynumber)->priv.server->free) + if (PRVM_EDICT_NUM(move->cursor_entitynumber)->free) move->cursor_entitynumber = 0; if (sv_message.badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__); } @@ -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 > 0.0 ? 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