From 7df63d3b92d552d9c51f718307e52a681cc827ac Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 27 Jun 2024 11:52:56 +0200 Subject: movement correction doesnt work well when respawning --- test-client/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test-client/main.ts') diff --git a/test-client/main.ts b/test-client/main.ts index b0b492ce..a572614b 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -139,9 +139,10 @@ function packet(p: PacketC) { case "position": { const pl = players.get(p.player)! const pos = { x: p.pos[0], y: p.pos[1] } - const dist = length(sub_v2(pl.position, pos)); + // const dist = length(sub_v2(pl.position, pos));a // TODO this is actually not a good idea if latency is too high - if (p.player == my_id && dist < 3) return; // we know better where we are + // if (p.player == my_id && dist < 3) return; // we know better where we are + if (p.player == my_id) return pl.position.x = pos.x pl.position.y = pos.y pl.rot = p.rot -- cgit v1.2.3-70-g09d2