From 8ddbc705262ad043749aba2eb9e64876088d52e7 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 9 Oct 2016 15:04:27 +1000 Subject: [PATCH] Restore behaviour after respawning if func_breakable is set to destroy when triggered --- qcsrc/common/triggers/func/breakable.qc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 13094e790..d2c8ee067 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -146,6 +146,7 @@ void func_breakable_behave_destroyed(entity this) stopsound (this, CH_TRIGGER_SINGLE); } +void func_breakable_destroy(entity this, entity actor, entity trigger); void func_breakable_behave_restore(entity this) { this.health = this.max_health; @@ -162,6 +163,8 @@ void func_breakable_behave_restore(entity this) this.bot_attack = true; this.event_damage = func_breakable_damage; } + if(this.spawnflags & 4) + this.use = func_breakable_destroy; // don't need to set it usually, as .use isn't reset this.state = 0; this.nextthink = 0; // cancel auto respawn func_breakable_colormod(this); -- 2.39.2