From: Mario Date: Sun, 9 Oct 2016 05:04:27 +0000 (+1000) Subject: Restore behaviour after respawning if func_breakable is set to destroy when triggered X-Git-Tag: xonotic-v0.8.2~528 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ddbc705262ad043749aba2eb9e64876088d52e7;p=xonotic%2Fxonotic-data.pk3dir.git Restore behaviour after respawning if func_breakable is set to destroy when triggered --- 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);