]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an extra spawnflag to func_train to replicate original (Quake 1) behaviour (only...
authorMario <mario@smbclan.net>
Mon, 12 Oct 2015 20:28:25 +0000 (06:28 +1000)
committerMario <mario@smbclan.net>
Mon, 12 Oct 2015 20:28:25 +0000 (06:28 +1000)
qcsrc/common/triggers/func/train.qc

index a75ac4192ee1b7bd6a7afe274fd0612b82bcc8bd..65414548b2e27f3926e41d5d4c3ad6416db7c568 100644 (file)
@@ -161,6 +161,13 @@ void train_link()
        //Net_LinkEntity(self, 0, false, train_send);
 }
 
+void train_use()
+{
+       self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
+       self.SUB_THINK = train_next;
+       self.use = func_null; // not again
+}
+
 void func_train_find()
 {SELFPARAM();
        entity targ;
@@ -169,8 +176,12 @@ void func_train_find()
        if (self.target == "")
                objerror("func_train_find: no next target");
        SUB_SETORIGIN(self, targ.origin - self.view_ofs);
-       self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
-       self.SUB_THINK = train_next;
+
+       if(!(self.spawnflags & 4))
+       {
+               self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
+               self.SUB_THINK = train_next;
+       }
 
        train_link();
 }
@@ -197,6 +208,9 @@ spawnfunc(func_train)
                return;
        self.effects |= EF_LOWPRECISION;
 
+       if(self.spawnflags & 4)
+               self.use = train_use;
+
        if (self.spawnflags & 2)
        {
                self.platmovetype_turn = true;