From: Mircea Kitsune Date: Tue, 22 May 2012 10:50:34 +0000 (+0300) Subject: Try to make the train turn in the direction it's facing while waiting (no velocity... X-Git-Tag: xonotic-v0.8.0~295^2~48 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86945e9e4fe1029f72248997a5c02fd551ae2001;p=xonotic%2Fxonotic-data.pk3dir.git Try to make the train turn in the direction it's facing while waiting (no velocity-based turning yet). Fixed the conflict with the wait function but something still goes wrong --- diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index d05cb5da7..0c316baa3 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -251,10 +251,21 @@ void spawnfunc_func_plat() plat_spawn_inside_trigger (); // the "start moving" trigger } - +.float train_wait_turning; void() train_next; 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) + { + entity targ; + targ = find(world, targetname, self.target); + SUB_CalcAngleMove(targ.origin, self.ltime + self.wait, train_wait); + self.train_wait_turning = TRUE; + return; + } + if(self.noise != "") stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway @@ -274,6 +285,7 @@ void train_wait() SUB_UseTargets(); self = oldself; self.enemy = world; + self.train_wait_turning = FALSE; } void train_next()