From 8f3c930799e7e46c363343733b6794f27f9ffff2 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 22 May 2012 16:57:20 +0300 Subject: [PATCH] Don't risk executing the wait code again after having turned, and skip re-waiting --- qcsrc/server/t_plats.qc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index cd0ce71b6..81cabfe64 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.bezier_turn && self.wait >= 0) + if(self.spawnflags & 1 && self.bezier_turn && self.wait >= 0) { entity targ; targ = find(world, targetname, self.target); @@ -269,8 +269,9 @@ void train_wait() if(self.noise != "") stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway - if(self.wait < 0) + if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning { + self.train_wait_turning = FALSE; train_next(); } else @@ -285,7 +286,6 @@ void train_wait() SUB_UseTargets(); self = oldself; self.enemy = world; - self.train_wait_turning = FALSE; } void train_next() -- 2.39.2