]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/button.qc
Merge branch 'master' into Mario/hagar_notfixed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / button.qc
index a55f02ef2fcc003852ef8aadde68dc799326f147..e9ae0a5472042f24cfbada02a1ce52cdbd9fd07d 100644 (file)
@@ -83,16 +83,16 @@ void button_touch()
        button_fire ();
 }
 
-void button_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
-       if(self.spawnflags & DOOR_NOSPLASH)
+void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+       if(this.spawnflags & DOOR_NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
                        return;
-       self.health = self.health - damage;
-       if (self.health <= 0)
+       this.health = this.health - damage;
+       if (this.health <= 0)
        {
-               self.enemy = damage_attacker;
-               button_fire ();
+               this.enemy = damage_attacker;
+               WITHSELF(this, button_fire());
        }
 }
 
@@ -112,9 +112,9 @@ When a button is touched, it moves some distance in the direction of it's angle,
 2) metallic click
 3) in-out
 */
-void spawnfunc_func_button()
-{SELFPARAM();
-       SetMovedir ();
+spawnfunc(func_button)
+{
+       SetMovedir(self);
 
        if (!InitMovingBrushTrigger())
                return;