From: Mircea Kitsune Date: Tue, 22 May 2012 13:57:20 +0000 (+0300) Subject: Don't risk executing the wait code again after having turned, and skip re-waiting X-Git-Tag: xonotic-v0.8.0~295^2~41 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8f3c930799e7e46c363343733b6794f27f9ffff2;p=xonotic%2Fxonotic-data.pk3dir.git Don't risk executing the wait code again after having turned, and skip re-waiting --- 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()