From: Mario Date: Mon, 12 Oct 2015 20:28:25 +0000 (+1000) Subject: Add an extra spawnflag to func_train to replicate original (Quake 1) behaviour (only... X-Git-Tag: xonotic-v0.8.2~1837 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=42414ef1f70f0e8a24dbb974e8aa660f1c0f4c22;p=xonotic%2Fxonotic-data.pk3dir.git Add an extra spawnflag to func_train to replicate original (Quake 1) behaviour (only starting moves when triggered) --- diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index a75ac4192..65414548b 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -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;