From: Cobalt <co...@te...> - 2016-04-09 06:44:19
|
Ok, I got it to compile, however I dont see a speed increase , at least not significant. The sideways "pulling" effect I had with the old code is gone though which is good. // Try new calculation sugguested by Number 6 local float f, ms, v; ms = cvar("sv_maxspeed"); f = ms * 1.6; // at 320 max, this is 576 v = vlen(self.velocity); if ((!self.cl[CL_CMD_FORWARD] || !self.cl[CL_CMD_SIDE])) { if (v > ms) self.velocity = self.velocity * 0.95;// (ms / v); // cap it } else if (v < f) { if (self.cl[CL_CMD_FORWARD] > 20) self.velocity = self.velocity * (f / v); else { f = ms * 1.25; if ( (fabs(self.cl[CL_CMD_SIDE]) > 20) || (self.cl[CL_CMD_FORWARD] < 20) ) self.velocity = self.velocity * (f / v); } } I am guessing the CL_CMD side and fwd are sending the values ok, though not sure if 20 is the velocity or something else? This is assumming we have the rune, and we have maxspeed set to 350 last time I looked. I forgot, there is a [ showspeed ] cvar you can activate which will show your moving speed nead the hud. So will do some more tests. |