vector antilag_takebackavgvelocity(entity e, float t0, float t1)
{
vector o0, o1;
- if(t0 == t1)
+ if(t0 >= t1)
return '0 0 0';
o0 = antilag_takebackorigin(e, t0);
o1 = antilag_takebackorigin(e, t1);
curspeed = max(
vlen(vec2(self.velocity)), // current xy speed
- vlen(vec2(antilag_takebackavgvelocity(self, time - 0.25, time))) // average xy topspeed over the last 0.25 secs
+ vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + 0.05, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
);
makevectors(self.v_angle_y * '0 1 0');
wishvel = v_forward * self.movement_x + v_right * self.movement_y;