From 513c7ff068881d7e29deae13463f371a236317e2 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Fri, 16 Apr 2021 18:07:54 -0400 Subject: [PATCH] Make physics anticheat less aggressive. --- server/src/sys/msg/in_game.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/sys/msg/in_game.rs b/server/src/sys/msg/in_game.rs index 69065553ea..624cec0893 100644 --- a/server/src/sys/msg/in_game.rs +++ b/server/src/sys/msg/in_game.rs @@ -119,8 +119,11 @@ impl Sys { // live server (and also mitigates some floating-point overflow crashes) if let Some(prev_pos) = positions.get(entity) { let value_squared = prev_pos.0.distance_squared(pos.0); - if value_squared > (5000.0f32).powf(2.0) { - setting.server_force = true; + if value_squared > (500.0f32).powf(2.0) { + // for position, this gets triggered too often by legitimate + // teleports (since the client has the old location for a few + // frames) so only reject the individual updates, don't force + // server-authoritative physics for them reject_update = true; warn!( "PlayerPhysics position exceeded {:?} {:?} {:?}",