]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_plats.qc
Get the correct formula for the still rotations. Just needs a few adjustments and...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_plats.qc
index e652defa6b1d0de19608a25c39b1b7b6cbc33eb8..9c0d057b03a31a33ff5b04db8334d72535dc446c 100644 (file)
@@ -299,20 +299,20 @@ void train_wait()
        self.enemy = world;
 
        // if turning is enabled, the train will turn toward the next point while waiting
-       if(self.bezier_turn && !self.train_wait_turning)
+       if(self.platmovetype_turn && !self.train_wait_turning)
        {
                entity targ, cp;
                vector org;
                targ = find(world, targetname, self.target);
-               if(self.spawnflags & 1 && targ.curve)
-                       cp = find(world, targetname, targ.curve);
+               if((self.spawnflags & 1) && targ.curvetarget)
+                       cp = find(world, targetname, targ.curvetarget);
                else
                        cp = world;
 
                if(cp) // bezier curves movement
-                       org = normalize(cp.origin - self.origin); // use the origin of the control point of the next path_corner
+                       org = vectoangles(cp.origin - self.origin); // use the origin of the control point of the next path_corner
                else // linear movement
-                       org = normalize(targ.origin - self.origin); // use the origin of the next path_corner
+                       org = vectoangles(targ.origin - self.origin); // use the origin of the next path_corner
 
                if(self.wait >= 0) // slow turning
                {
@@ -321,9 +321,7 @@ void train_wait()
                        return;
                }
                else // instant turning
-               {
-                       self.angles = vectoangles(org - self.origin);
-               }
+                       self.angles = org;
        }
 
        if(self.noise != "")
@@ -350,9 +348,9 @@ void train_next()
        self.target = targ.target;
        if (self.spawnflags & 1)
        {
-               if(targ.curve)
+               if(targ.curvetarget)
                {
-                       cp = find(world, targetname, targ.curve); // get its second target (the control point)
+                       cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
                        cp_org = cp.origin - self.mins; // no control point found, assume a straight line to the destination
                }
                else
@@ -423,7 +421,7 @@ void spawnfunc_func_train()
        if (!self.speed)
                self.speed = 100;
        if (self.spawnflags & 2)
-               self.bezier_turn = TRUE;
+               self.platmovetype_turn = TRUE;
 
        if not(InitMovingBrushTrigger())
                return;