X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fbutton.qc;h=a1cabdc6c0326d2fa82bb766bfc1f5cd8c87abef;hb=42e255d014f2c6a1871177ea511f630624cdfb57;hp=ab1cff538ef2e1bbbd6c020208578ce326ae7a03;hpb=1af8ea71282d19f66c96622815c68943eaa36aba;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index ab1cff538..a1cabdc6c 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -9,8 +9,7 @@ void button_wait() self.state = STATE_TOP; self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait; self.SUB_THINK = button_return; - activator = self.enemy; - SUB_UseTargets(); + SUB_UseTargets(self, self.enemy, NULL); self.frame = 1; // use alternate textures } @@ -60,13 +59,13 @@ void button_reset() self.takedamage = DAMAGE_YES; // can be shot again } -void button_use() -{SELFPARAM(); - if(self.active != ACTIVE_ACTIVE) +void button_use(entity this, entity actor, entity trigger) +{ + if(this.active != ACTIVE_ACTIVE) return; - self.enemy = activator; - button_fire (); + this.enemy = actor; + WITHSELF(this, button_fire()); } void button_touch() @@ -83,16 +82,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()); } } @@ -114,7 +113,7 @@ When a button is touched, it moves some distance in the direction of it's angle, */ spawnfunc(func_button) { - SetMovedir (); + SetMovedir(self); if (!InitMovingBrushTrigger()) return;