]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/platforms.qc
Merge branch 'master' into TimePath/deathtypes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / platforms.qc
index b837d7c5a8788c43d36d019e08919dfe4d9966e4..1c8a8bbad45766a10538139667d0bf5061077eaa 100644 (file)
@@ -1,23 +1,23 @@
 void generic_plat_blocked()
-{
+{SELFPARAM();
 #ifdef SVQC
        if(self.dmg && other.takedamage != DAMAGE_NO)
        {
                if(self.dmgtime2 < time)
                {
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        self.dmgtime2 = time + self.dmgtime;
                }
 
                // Gib dead/dying stuff
                if(other.deadflag != DEAD_NO)
-                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
        }
 #endif
 }
 
 void plat_spawn_inside_trigger()
-{
+{SELFPARAM();
        entity trigger;
        vector tmin, tmax;
 
@@ -64,8 +64,8 @@ void plat_spawn_inside_trigger()
 }
 
 void plat_hit_top()
-{
-       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+{SELFPARAM();
+       _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 1;
 
        self.SUB_THINK = plat_go_down;
@@ -73,27 +73,27 @@ void plat_hit_top()
 }
 
 void plat_hit_bottom()
-{
-       sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+{SELFPARAM();
+       _sound (self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
        self.state = 2;
 }
 
 void plat_go_down()
-{
-       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
+{SELFPARAM();
+       _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);
 }
 
 void plat_go_up()
-{
-       sound (self, CH_TRIGGER_SINGLE, self.noise, VOL_BASE, ATTEN_NORM);
+{SELFPARAM();
+       _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);
 }
 
 void plat_center_touch()
-{
+{SELFPARAM();
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -107,7 +107,7 @@ void plat_center_touch()
                return;
 #endif
 
-       self = self.enemy;
+       setself(self.enemy);
        if (self.state == 2)
                plat_go_up ();
        else if (self.state == 1)
@@ -115,7 +115,7 @@ void plat_center_touch()
 }
 
 void plat_outside_touch()
-{
+{SELFPARAM();
 #ifdef SVQC
        if (!other.iscreature)
                return;
@@ -127,13 +127,13 @@ void plat_outside_touch()
                return;
 #endif
 
-       self = self.enemy;
+       setself(self.enemy);
        if (self.state == 1)
                plat_go_down ();
 }
 
 void plat_trigger_use()
-{
+{SELFPARAM();
 #ifdef SVQC
        if (self.think)
                return;         // already activated
@@ -146,11 +146,11 @@ void plat_trigger_use()
 
 
 void plat_crush()
-{
+{SELFPARAM();
        if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO))
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
@@ -158,10 +158,10 @@ void plat_crush()
 #ifdef SVQC
                if((self.dmg) && (other.takedamage != DAMAGE_NO))
                {   // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        // Gib dead/dying stuff
                        if(other.deadflag != DEAD_NO)
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
 
@@ -176,7 +176,7 @@ void plat_crush()
 }
 
 void plat_use()
-{
+{SELFPARAM();
        self.use = func_null;
        if (self.state != 4)
                objerror ("plat_use: not in up state");
@@ -186,7 +186,7 @@ void plat_use()
 .string sound1, sound2;
 
 void plat_reset()
-{
+{SELFPARAM();
        IFTARGETED
        {
                setorigin (self, self.pos1);