X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fbutton.qc;h=8ded50d16b2da0d88a35c68eb333006786a15636;hb=1a02dfa42534cfd8697e6c4d0e1181e5ec6c1fc7;hp=c450aaa1f2a7b5f429033b51fb05763c1c1ed733;hpb=53911d2ce2724f2da23fb6806e491ce795ae4326;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index c450aaa1f2..8ded50d16b 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -8,8 +8,11 @@ void button_return(entity this); void button_wait(entity this) { this.state = STATE_TOP; - this.nextthink = this.ltime + this.wait; - setthink(this, button_return); + if(this.wait >= 0) + { + this.nextthink = this.ltime + this.wait; + setthink(this, button_return); + } SUB_UseTargets(this, this.enemy, NULL); this.frame = 1; // use alternate textures } @@ -56,6 +59,9 @@ void button_reset(entity this) setorigin(this, this.pos1); this.frame = 0; // use normal textures this.state = STATE_BOTTOM; + this.velocity = '0 0 0'; + setthink(this, func_null); + this.nextthink = 0; if (this.health) this.takedamage = DAMAGE_YES; // can be shot again } @@ -91,7 +97,7 @@ void button_damage(entity this, entity inflictor, entity attacker, float damage, this.health = this.health - damage; if (this.health <= 0) { - this.enemy = damage_attacker; + this.enemy = attacker; button_fire(this); } } @@ -150,6 +156,8 @@ spawnfunc(func_button) this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip); this.flags |= FL_NOTARGET; + this.reset = button_reset; + button_reset(this); } #endif