Fixed possible recursion bug with breakables and other dead-triggers.

This commit is contained in:
Marco Cawthorne 2020-03-29 21:39:32 +02:00
parent 19a4db076b
commit ea5851a8f5
2 changed files with 7 additions and 1 deletions

View file

@ -165,7 +165,8 @@ void func_breakable::Death(int body)
void func_breakable::Trigger(void)
{
func_breakable::Death(0);
if (health > 0)
func_breakable::Death(0);
}
/*void func_breakable::PressureDeath(void)

View file

@ -40,6 +40,11 @@ Damage_Apply(entity t, entity c, float dmg, int w, int type)
return;
}
/* already dead, please avoid recursion */
if (t.health <= 0) {
return;
}
/* skip armor */
if not (type & DMG_SKIP_ARMOR)
if (t.armor && dmg > 0) {