From 0ed9b2f05a17764d04877d88f947f0ec5e756817 Mon Sep 17 00:00:00 2001 From: Freddy Date: Thu, 7 Sep 2017 16:54:02 +0200 Subject: [PATCH] Properly handle .active state for func_button --- qcsrc/common/triggers/func/button.qc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qcsrc/common/triggers/func/button.qc b/qcsrc/common/triggers/func/button.qc index 8ded50d16..8c157d93c 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; -- 2.39.2