]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Restore behaviour after respawning if func_breakable is set to destroy when triggered
authorMario <mario@smbclan.net>
Sun, 9 Oct 2016 05:04:27 +0000 (15:04 +1000)
committerMario <mario@smbclan.net>
Sun, 9 Oct 2016 05:04:27 +0000 (15:04 +1000)
qcsrc/common/triggers/func/breakable.qc

index 13094e790aa527db25853d5a7f72944490c2b57b..d2c8ee06770202e2c23dc25b3fe3223caae385a9 100644 (file)
@@ -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);