]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/train.qc
Merge branch 'master' into Mario/snake
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / train.qc
index 001a75985a9075336f44961d7cf9921491275169..187fd3f1b97be9174c2bbdf962be42f507c0c104 100644 (file)
@@ -1,12 +1,8 @@
 .float train_wait_turning;
 void() train_next;
 void train_wait()
-{
-       entity oldself;
-       oldself = self;
-       self = self.enemy;
-       SUB_UseTargets();
-       self = oldself;
+{SELFPARAM();
+       WITH(entity, self, self.enemy, SUB_UseTargets());
        self.enemy = world;
 
        // if turning is enabled, the train will turn toward the next point while waiting
@@ -53,7 +49,7 @@ void train_wait()
 }
 
 void train_next()
-{
+{SELFPARAM();
        entity targ, cp = world;
        vector cp_org = '0 0 0';
 
@@ -102,12 +98,12 @@ void train_next()
        }
 
        if(self.noise != "")
-               sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
+               _sound(self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_IDLE);
 }
 
 #ifdef SVQC
 float train_send(entity to, float sf)
-{
+{SELFPARAM();
        WriteByte(MSG_ENTITY, ENT_CLIENT_TRAIN);
        WriteByte(MSG_ENTITY, sf);
 
@@ -166,7 +162,7 @@ void train_link()
 }
 
 void func_train_find()
-{
+{SELFPARAM();
        entity targ;
        targ = find(world, targetname, self.target);
        self.target = targ.target;
@@ -188,7 +184,7 @@ target : targetname of first spawnfunc_path_corner (starts here)
 */
 #ifdef SVQC
 void spawnfunc_func_train()
-{
+{SELFPARAM();
        if (self.noise != "")
                precache_sound(self.noise);
 
@@ -200,7 +196,7 @@ void spawnfunc_func_train()
        if (!InitMovingBrushTrigger())
                return;
        self.effects |= EF_LOWPRECISION;
-       
+
        if (self.spawnflags & 2)
        {
                self.platmovetype_turn = true;
@@ -236,7 +232,7 @@ void train_draw()
 }
 
 void ent_train()
-{
+{SELFPARAM();
        float sf = ReadByte();
 
        if(sf & SF_TRIGGER_INIT)
@@ -246,7 +242,7 @@ void ent_train()
                self.spawnflags = ReadByte();
 
                self.model = strzone(ReadString());
-               setmodel(self, self.model);
+               _setmodel(self, self.model);
 
                trigger_common_read(true);