From: Maik Merten Date: Sun, 21 Nov 2010 17:19:55 +0000 (+0100) Subject: use traditional linear movement for short animations (< 0.3 seconds) as the movement... X-Git-Tag: xonotic-v0.5.0~311^2~37^2^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03d8c5662a307caed1a0ac242a573f8cff4d67e9;p=xonotic%2Fxonotic-data.pk3dir.git use traditional linear movement for short animations (< 0.3 seconds) as the movement controller only ticks once every 0.1 seconds and thus would give inaccurate results --- diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index a401b60bd..ad9d752fc 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -248,6 +248,15 @@ 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) + { + self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division + self.nextthink = self.ltime + traveltime; + return; + } + controller = spawn(); controller.classname = "SUB_CalcMove_controller"; controller.owner = self; @@ -259,8 +268,7 @@ void SUB_CalcMove (vector tdest, float tspeed, void() func) controller.think = SUB_CalcMove_controller_think; controller.think1 = self.think; - // let the controller handle the velocity compuation - //self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division + // the thinking is now done by the controller self.think = SUB_Null; self.nextthink = self.ltime + traveltime;