]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use a second spawnflag to make the train turn (otherwise it will just move, even...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 22 May 2012 11:30:41 +0000 (14:30 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 22 May 2012 11:30:41 +0000 (14:30 +0300)
qcsrc/server/g_subs.qc
qcsrc/server/t_plats.qc

index 9547be60f787ef20a0f443e29a4cbbab2b3ac20c..8f19ee3c5400ea9a509c0dde02fe38e0cecade4b 100644 (file)
@@ -171,6 +171,7 @@ void SUB_CalcMoveDone (void)
                self.think1 ();
 }
 
+.float bezier_turn;
 void SUB_CalcMove_controller_think (void)
 {
        entity oldself;
@@ -206,7 +207,8 @@ void SUB_CalcMove_controller_think (void)
                        veloc = veloc * (1 / sys_frametime); // so it arrives for the next frame
                }
                self.owner.velocity = veloc;
-               self.owner.angles = vectoangles(delta + 2 * delta2 * phasepos);
+               if(self.owner.bezier_turn)
+                       self.owner.angles = vectoangles(delta + 2 * delta2 * phasepos);
                self.nextthink = nexttick;
        } else {
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
index 0c316baa343dc6ffea1c86e3971c0850d4b800c6..d6b39768b8aa0ccc1f55754763b57d088f922290 100644 (file)
@@ -257,7 +257,7 @@ void train_wait()
 {
        // 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.wait >= 0)
+       if (self.spawnflags & 1 && self.bezier_turn && self.wait >= 0)
        {
                entity targ;
                targ = find(world, targetname, self.target);
@@ -355,6 +355,8 @@ void spawnfunc_func_train()
                objerror("func_train without a target");
        if (!self.speed)
                self.speed = 100;
+       if (self.spawnflags & 2)
+               self.bezier_turn = TRUE;
 
        if not(InitMovingBrushTrigger())
                return;