]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/platforms.qc
Clean out some more SELFPARAMs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / platforms.qc
index 51c2ac8cc823c89eb6ee669b83ce053c3f80eac4..3819e9c7fc97d7549fb1cd2d0c9883588ac433be 100644 (file)
@@ -17,8 +17,8 @@ void generic_plat_blocked()
 #endif
 }
 
-void plat_spawn_inside_trigger()
-{SELFPARAM();
+void plat_spawn_inside_trigger(entity this)
+{
        entity trigger;
        vector tmin, tmax;
 
@@ -58,37 +58,37 @@ void plat_spawn_inside_trigger()
        objerror("plat_spawn_inside_trigger: platform has odd size or lip, can't spawn");
 }
 
-void plat_hit_top()
-{SELFPARAM();
+void plat_hit_top(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 1;
 
-       self.SUB_THINK = plat_go_down;
+       SUB_THINK(self, plat_go_down);
        self.SUB_NEXTTHINK = self.SUB_LTIME + 3;
 }
 
-void plat_hit_bottom()
-{SELFPARAM();
+void plat_hit_bottom(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 2;
 }
 
-void plat_go_down()
-{SELFPARAM();
+void plat_go_down(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 3;
-       SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
+       SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, plat_hit_bottom);
 }
 
-void plat_go_up()
-{SELFPARAM();
+void plat_go_up(entity this)
+{
        _sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
        self.state = 4;
-       SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
+       SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, plat_hit_top);
 }
 
-void plat_center_touch()
-{SELFPARAM();
+void plat_center_touch(entity this)
+{
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -102,14 +102,15 @@ void plat_center_touch()
                return;
 #endif
 
-       if (self.enemy.state == 2)
-               WITHSELF(self.enemy, plat_go_up());
-       else if (self.enemy.state == 1)
+       if (self.enemy.state == 2) {
+               entity e = self.enemy;
+               WITHSELF(e, plat_go_up(e));
+       } else if (self.enemy.state == 1)
                self.enemy.SUB_NEXTTHINK = self.enemy.SUB_LTIME + 1;
 }
 
-void plat_outside_touch()
-{SELFPARAM();
+void plat_outside_touch(entity this)
+{
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -121,20 +122,22 @@ void plat_outside_touch()
                return;
 #endif
 
-       if (self.enemy.state == 1)
-               WITHSELF(self.enemy, plat_go_down());
+       if (self.enemy.state == 1) {
+           entity e = self.enemy;
+               WITHSELF(e, plat_go_down(e));
+    }
 }
 
 void plat_trigger_use(entity this, entity actor, entity trigger)
 {
 #ifdef SVQC
-       if (this.think)
+       if (getthink(this))
                return;         // already activated
 #elif defined(CSQC)
        if(this.move_think)
                return;
 #endif
-       WITHSELF(this, plat_go_down());
+       WITHSELF(this, plat_go_down(this));
 }
 
 
@@ -159,9 +162,9 @@ void plat_crush()
 #endif
 
                if (self.state == 4)
-                       plat_go_down ();
+                       plat_go_down (self);
                else if (self.state == 3)
-                       plat_go_up ();
+                       plat_go_up (self);
        // when in other states, then the plat_crush event came delayed after
        // plat state already had changed
        // this isn't a bug per se!
@@ -173,7 +176,7 @@ void plat_use(entity this, entity actor, entity trigger)
        this.use = func_null;
        if (this.state != 4)
                objerror ("plat_use: not in up state");
-       WITHSELF(this, plat_go_down());
+       WITHSELF(this, plat_go_down(this));
 }
 
 .string sound1, sound2;