From a0b2b65a0179da4512c7fe31fd318d7b32e4a7bd Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 19 Sep 2023 21:35:23 -0700 Subject: [PATCH] TEMP: fix menacing circle strafing --- src/body.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/body.rs b/src/body.rs index 9c1cc3a..967be3f 100644 --- a/src/body.rs +++ b/src/body.rs @@ -122,9 +122,9 @@ impl MouseInterpolationState { let m0=self.mouse0.as_i64vec2(); let m1=self.mouse1.as_i64vec2(); //these are deltas - let t1t=(self.time1-time) as i64; - let tt0=(time-self.time0) as i64; let dt=(self.time1-self.time0) as i64; + let t1t=(self.time1-time).clamp(0,dt) as i64; + let tt0=(time-self.time0).clamp(0,dt) as i64; ((m0*t1t+m1*tt0)/dt).as_ivec2() } }