From: Maik Merten Date: Wed, 24 Nov 2010 20:38:23 +0000 (+0100) Subject: make the SUB_CalcMove controller think every frame. This increases smoothness and... X-Git-Tag: xonotic-v0.5.0~311^2~37^2^2~6 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=ee2d9597471c4ef4b300a93f163f8d96c78f6cf7;ds=inline make the SUB_CalcMove controller think every frame. This increases smoothness and vastly reduces the amount of player unstuck messages (usually by 0 0 1) when, e.g., lifts stop --- diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 180dee305a..fe7a7e29f0 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -188,7 +188,7 @@ void SUB_CalcMove_controller_think (void) vector nextpos; if(time < self.animstate_endtime) { delta = self.destvec; - nexttick = time + 0.1; + nexttick = time + sys_frametime; if(nexttick < self.animstate_endtime) { traveltime = self.animstate_endtime - self.animstate_starttime; @@ -200,12 +200,11 @@ void SUB_CalcMove_controller_think (void) nextpos = self.origin + (delta * phasepos); veloc = nextpos - self.owner.origin; - veloc = veloc * 10; // so it arrives in 0.1 seconds + veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame } else { veloc = self.finaldest - self.owner.origin; - veloc = veloc * 10; // so it arrives in 0.1 seconds - self.nextthink = self.animstate_endtime; + veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame } self.owner.velocity = veloc; self.nextthink = nexttick; @@ -248,9 +247,9 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func) return; } - // the controller only thinks every 0.1 seconds, so very short - // animations should just use the traditional movement - if (traveltime < 0.3) + // very short animations don't really show off the effect + // of controlled animation, so let's just use linear movement + if (traveltime < 0.15) { self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division self.nextthink = self.ltime + traveltime;