]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Modify still turning code to accept rotation toward the next target for both bezier...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 14:43:39 +0000 (17:43 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 14:43:39 +0000 (17:43 +0300)
qcsrc/server/t_plats.qc

index ad2f2fa46c6fe18cb35dc2247f86044bb996213f..e4772323a38228f5bc69c27606c3d3c9cb2576ce 100644 (file)
@@ -298,15 +298,23 @@ void train_wait()
        self = oldself;
        self.enemy = world;
 
-       // if using bezier curves and turning is enabled, the train will turn toward the next point while waiting
-       if(!self.train_wait_turning)
-       if(self.spawnflags & 1 && self.bezier_turn && self.wait >= 0)
+       // if turning is enabled, the train will turn toward the next point while waiting
+       if(self.wait >= 0 && self.bezier_turn && !self.train_wait_turning)
        {
                entity targ;
                vector org;
-               targ = find(world, targetname, self.target);
-               org = normalize(targ.origin);
-               SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+               if(self.spawnflags & 1) // bezier curves movement
+               {
+                       targ = find(world, targetname, self.target);
+                       org = normalize(targ.origin);
+                       SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+               }
+               else
+               {
+                       targ = find(world, targetname, self.target);
+                       org = normalize(targ.origin);
+                       SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+               }
                self.train_wait_turning = TRUE;
                return;
        }