From b26660be6383eafc95fbc96dae8acff30be0556f Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Thu, 24 May 2012 17:53:30 +0300 Subject: [PATCH] Fix some important mistakes in the last commit --- qcsrc/server/t_plats.qc | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index e4772323a3..f27bb2b9ff 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -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 != "") -- 2.39.2