]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/button.qc
Merge branch 'Mario/fireball_merge' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / button.qc
index 8424776ff0645a1c39ccfda635d81d05ba24d9c0..b186066e602b1523586a6d4f299a162445ee7efa 100644 (file)
@@ -28,7 +28,7 @@ void button_return(entity this)
 }
 
 
-void button_blocked()
+void button_blocked(entity this, entity blocker)
 {
        // do nothing, just don't come all the way back out
 }
@@ -65,20 +65,20 @@ void button_use(entity this, entity actor, entity trigger)
                return;
 
        this.enemy = actor;
-       WITHSELF(this, button_fire(this));
+       button_fire(this);
 }
 
-void button_touch(entity this)
+void button_touch(entity this, entity toucher)
 {
-       if (!other)
+       if (!toucher)
                return;
-       if (!other.iscreature)
+       if (!toucher.iscreature)
                return;
-       if(other.velocity * this.movedir < 0)
+       if(toucher.velocity * this.movedir < 0)
                return;
-       this.enemy = other;
-       if (other.owner)
-               this.enemy = other.owner;
+       this.enemy = toucher;
+       if (toucher.owner)
+               this.enemy = toucher.owner;
        button_fire (this);
 }
 
@@ -91,7 +91,7 @@ void button_damage(entity this, entity inflictor, entity attacker, float damage,
        if (this.health <= 0)
        {
                this.enemy = damage_attacker;
-               WITHSELF(this, button_fire(this));
+               button_fire(this);
        }
 }
 
@@ -119,7 +119,7 @@ spawnfunc(func_button)
                return;
        this.effects |= EF_LOWPRECISION;
 
-       this.blocked = button_blocked;
+       setblocked(this, button_blocked);
        this.use = button_use;
 
 //     if (this.health == 0) // all buttons are now shootable