]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
use traditional linear movement for short animations (< 0.3 seconds) as the movement...
authorMaik Merten <maikmerten@googlemail.com>
Sun, 21 Nov 2010 17:19:55 +0000 (18:19 +0100)
committerMaik Merten <maikmerten@googlemail.com>
Sun, 21 Nov 2010 17:19:55 +0000 (18:19 +0100)
qcsrc/server/g_subs.qc

index a401b60bdc84b935d8cf9dc6e7c0109861039111..ad9d752fcbed9b96e6f8db694fc2ea88a646d486 100644 (file)
@@ -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;