X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fbutton.qc;h=ed972cd9f97b1c78b86e2c9414af318c351f1181;hb=0a20a065f61e6235f62801362a25dfb0a70c6a14;hp=0a0547b58726e64c1c5fde2c7aa3e37b661ba943;hpb=1add7fc6b9e512dcfcfd3180505046449ac782cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index 0a0547b58..ed972cd9f 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -1,27 +1,27 @@ #ifdef SVQC // button and multiple button -void() button_wait; -void() button_return; +void button_wait(entity this); +void button_return(entity this); -void button_wait() -{SELFPARAM(); +void button_wait(entity this) +{ self.state = STATE_TOP; self.SUB_NEXTTHINK = self.SUB_LTIME + self.wait; - self.SUB_THINK = button_return; + SUB_THINK(self, button_return); SUB_UseTargets(self, self.enemy, NULL); self.frame = 1; // use alternate textures } -void button_done() -{SELFPARAM(); +void button_done(entity this) +{ self.state = STATE_BOTTOM; } -void button_return() -{SELFPARAM(); +void button_return(entity this) +{ self.state = STATE_DOWN; - SUB_CalcMove (self.pos1, TSPEED_LINEAR, self.speed, button_done); + SUB_CalcMove (self, self.pos1, TSPEED_LINEAR, self.speed, button_done); self.frame = 0; // use normal textures if (self.health) self.takedamage = DAMAGE_YES; // can be shot again @@ -34,8 +34,8 @@ void button_blocked() } -void button_fire() -{SELFPARAM(); +void button_fire(entity this) +{ self.health = self.max_health; self.takedamage = DAMAGE_NO; // will be reset upon return @@ -46,7 +46,7 @@ void button_fire() _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM); self.state = STATE_UP; - SUB_CalcMove (self.pos2, TSPEED_LINEAR, self.speed, button_wait); + SUB_CalcMove (self, self.pos2, TSPEED_LINEAR, self.speed, button_wait); } void button_reset(entity this) @@ -65,11 +65,11 @@ void button_use(entity this, entity actor, entity trigger) return; this.enemy = actor; - WITHSELF(this, button_fire()); + WITHSELF(this, button_fire(this)); } -void button_touch() -{SELFPARAM(); +void button_touch(entity this) +{ if (!other) return; if (!other.iscreature) @@ -79,7 +79,7 @@ void button_touch() self.enemy = other; if (other.owner) self.enemy = other.owner; - button_fire (); + button_fire (self); } void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) @@ -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()); + WITHSELF(this, button_fire(this)); } }