Fixed possible recursion bug with breakables and other dead-triggers.
This commit is contained in:
parent
19a4db076b
commit
ea5851a8f5
2 changed files with 7 additions and 1 deletions
|
@ -165,6 +165,7 @@ void func_breakable::Death(int body)
|
||||||
|
|
||||||
void func_breakable::Trigger(void)
|
void func_breakable::Trigger(void)
|
||||||
{
|
{
|
||||||
|
if (health > 0)
|
||||||
func_breakable::Death(0);
|
func_breakable::Death(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,11 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* already dead, please avoid recursion */
|
||||||
|
if (t.health <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* skip armor */
|
/* skip armor */
|
||||||
if not (type & DMG_SKIP_ARMOR)
|
if not (type & DMG_SKIP_ARMOR)
|
||||||
if (t.armor && dmg > 0) {
|
if (t.armor && dmg > 0) {
|
||||||
|
|
Loading…
Reference in a new issue