X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fbreakable.qc;h=b6dcd01f8843cc5f9310db9b93d213c4848e80ed;hb=ac9fba402abf745436adf0ecaa8f90347708ff53;hp=b922a65b6af994501fc21bc0e5d8152e190eef83;hpb=c51788ec53d7f106eeb712416df3ff2bdf85c1c0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index b922a65b6..b6dcd01f8 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -109,6 +109,7 @@ void func_breakable_look_destroyed(entity this) this.origin_z = floorZ; } _setmodel(this, this.mdl_dead); + ApplyMinMaxScaleAngles(this); this.effects &= ~EF_NODRAW; } @@ -120,6 +121,7 @@ void func_breakable_look_destroyed(entity this) void func_breakable_look_restore(entity this) { _setmodel(this, this.mdl); + ApplyMinMaxScaleAngles(this); this.effects &= ~EF_NODRAW; if(this.mdl_dead != "") // only do this if we use mdl_dead, to behave better with misc_follow @@ -134,6 +136,8 @@ void func_breakable_behave_destroyed(entity this) { this.health = this.max_health; this.takedamage = DAMAGE_NO; + if(this.bot_attack) + IL_REMOVE(g_bot_targets, this); this.bot_attack = false; this.event_damage = func_null; this.state = 1; @@ -144,6 +148,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; @@ -155,9 +160,13 @@ void func_breakable_behave_restore(entity this) if(!(this.spawnflags & 4)) { this.takedamage = DAMAGE_AIM; + if(!this.bot_attack) + IL_PUSH(g_bot_targets, 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);