From: Freddy Date: Thu, 7 Sep 2017 14:54:02 +0000 (+0200) Subject: Properly handle .active state for func_button X-Git-Tag: xonotic-v0.8.5~1807^2~2^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ed9b2f05a17764d04877d88f947f0ec5e756817;p=xonotic%2Fxonotic-data.pk3dir.git Properly handle .active state for func_button --- diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index 8ded50d16b..8c157d93cc 100644 --- a/qcsrc/common/triggers/func/button.qc +++ b/qcsrc/common/triggers/func/button.qc @@ -24,6 +24,12 @@ void button_done(entity this) void button_return(entity this) { + if (this.active != ACTIVE_ACTIVE) + { + this.nextthink = this.ltime + frametime; + setthink(this, button_return); + return; + } this.state = STATE_DOWN; SUB_CalcMove (this, this.pos1, TSPEED_LINEAR, this.speed, button_done); this.frame = 0; // use normal textures @@ -77,6 +83,8 @@ void button_use(entity this, entity actor, entity trigger) void button_touch(entity this, entity toucher) { + if (this.active != ACTIVE_ACTIVE) + return; if (!toucher) return; if (!toucher.iscreature) @@ -91,6 +99,8 @@ void button_touch(entity this, entity toucher) void button_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) { + if (this.active != ACTIVE_ACTIVE) + return; if(this.spawnflags & DOOR_NOSPLASH) if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH)) return;