Fixed "collection was modified" exceptions if a huskified human dies in a fire
This commit is contained in:
@@ -245,8 +245,9 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (size.X <= 0.0f) return;
|
if (size.X <= 0.0f) return;
|
||||||
|
|
||||||
foreach (Character c in Character.CharacterList)
|
for (int i = 0; i < Character.CharacterList.Count; i++)
|
||||||
{
|
{
|
||||||
|
Character c = Character.CharacterList[i];
|
||||||
if (c.AnimController.CurrentHull == null || c.IsDead) continue;
|
if (c.AnimController.CurrentHull == null || c.IsDead) continue;
|
||||||
|
|
||||||
float range = (float)Math.Sqrt(size.X) * 20.0f;
|
float range = (float)Math.Sqrt(size.X) * 20.0f;
|
||||||
@@ -256,9 +257,9 @@ namespace Barotrauma
|
|||||||
float dmg = (float)Math.Sqrt(size.X) * deltaTime / c.AnimController.Limbs.Length;
|
float dmg = (float)Math.Sqrt(size.X) * deltaTime / c.AnimController.Limbs.Length;
|
||||||
foreach (Limb limb in c.AnimController.Limbs)
|
foreach (Limb limb in c.AnimController.Limbs)
|
||||||
{
|
{
|
||||||
if (limb.WearingItems.Find(w => w!=null && w.WearableComponent.Item.FireProof)!=null) continue;
|
if (limb.WearingItems.Find(w => w != null && w.WearableComponent.Item.FireProof) != null) continue;
|
||||||
limb.Burnt += dmg * 10.0f;
|
limb.Burnt += dmg * 10.0f;
|
||||||
c.AddDamage(limb.SimPosition, DamageType.None, dmg, 0,0,false);
|
c.AddDamage(limb.SimPosition, DamageType.None, dmg, 0, 0, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user