]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a way to pause a train until triggered again
authorMario <mario@smbclan.net>
Tue, 15 Dec 2015 08:16:52 +0000 (18:16 +1000)
committerMario <mario@smbclan.net>
Tue, 15 Dec 2015 08:16:52 +0000 (18:16 +1000)
qcsrc/common/triggers/func/train.qc

index e02b917d1cc118cfc73c0cffea72f60790f3ee29..909b8f5e8b37938f8c68cbae639d5beeaf80417e 100644 (file)
@@ -36,7 +36,17 @@ void train_wait()
                stopsoundto(MSG_BROADCAST, self, CH_TRIGGER_SINGLE); // send this as unreliable only, as the train will resume operation shortly anyway
 #endif
 
-       if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
+#ifdef SVQC
+       entity tg = find(world, targetname, self.target);
+       if(tg.spawnflags & 4)
+       {
+               self.use = train_use;
+               self.SUB_THINK = func_null;
+               self.SUB_NEXTTHINK = 0;
+       }
+       else
+#endif
+            if(self.wait < 0 || self.train_wait_turning) // no waiting or we already waited while turning
        {
                self.train_wait_turning = false;
                train_next();