From 8ce5f245645946cfdbc20fc77ed1ed7057b5e6ad Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Thu, 24 May 2012 17:43:39 +0300 Subject: [PATCH] Modify still turning code to accept rotation toward the next target for both bezier and non-bezier movement. This doesn't happen yet, and the turning is still incorrect --- qcsrc/server/t_plats.qc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index ad2f2fa46..e4772323a 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -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; } -- 2.39.2