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,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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue