]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some important mistakes in the last commit
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 14:53:30 +0000 (17:53 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 24 May 2012 14:53:30 +0000 (17:53 +0300)
qcsrc/server/t_plats.qc

index e4772323a38228f5bc69c27606c3d3c9cb2576ce..f27bb2b9ff617d14a7c9973b66591c5d47cd81a2 100644 (file)
@@ -299,24 +299,39 @@ void train_wait()
        self.enemy = world;
 
        // 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)
+       if(self.bezier_turn && !self.train_wait_turning)
        {
                entity targ;
                vector org;
+               targ = find(world, targetname, self.target);
                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);
+                       if(self.wait >= 0)
+                       {
+                               SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+                               self.train_wait_turning = TRUE;
+                               return;
+                       }
+                       else
+                       {
+                               self.angles = vectoangles(targ.origin - self.origin);
+                       }
                }
                else
                {
-                       targ = find(world, targetname, self.target);
                        org = normalize(targ.origin);
-                       SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+                       if(self.wait >= 0)
+                       {
+                               SUB_CalcAngleMove(org, TSPEED_TIME, self.ltime - time + self.wait, train_wait);
+                               self.train_wait_turning = TRUE;
+                               return;
+                       }
+                       else
+                       {
+                               self.angles = vectoangles(targ.origin - self.origin);
+                       }
                }
-               self.train_wait_turning = TRUE;
-               return;
        }
 
        if(self.noise != "")