From: Mircea Kitsune Date: Tue, 22 May 2012 11:30:41 +0000 (+0300) Subject: Use a second spawnflag to make the train turn (otherwise it will just move, even... X-Git-Tag: xonotic-v0.8.0~295^2~45 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=778b291f050a48a6ccff737a2897be38ad3883cc;p=xonotic%2Fxonotic-data.pk3dir.git Use a second spawnflag to make the train turn (otherwise it will just move, even on bezier curves) --- diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 9547be60f..8f19ee3c5 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -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) diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 0c316baa3..d6b39768b 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -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;