Unstable 0.1400.0.0
This commit is contained in:
@@ -833,6 +833,32 @@ namespace Barotrauma
|
||||
#endif
|
||||
}
|
||||
|
||||
// We need to use another list of the afflictions when we call the status effects triggered by afflictions,
|
||||
// because those status effects may add or remove other afflictions while iterating the collection.
|
||||
private readonly List<Affliction> afflictionsCopy = new List<Affliction>();
|
||||
public void ApplyAfflictionStatusEffects(ActionType type)
|
||||
{
|
||||
for (int i = 0; i < limbHealths.Count; i++)
|
||||
{
|
||||
for (int j = limbHealths[i].Afflictions.Count - 1; j >= 0; j--)
|
||||
{
|
||||
var affliction = limbHealths[i].Afflictions[j];
|
||||
Limb targetLimb = Character.AnimController.Limbs.LastOrDefault(l => !l.IsSevered && !l.Hidden && l.HealthIndex == i);
|
||||
if (targetLimb == null)
|
||||
{
|
||||
targetLimb = Character.AnimController.MainLimb;
|
||||
}
|
||||
affliction.ApplyStatusEffects(type, 1.0f, this, targetLimb);
|
||||
}
|
||||
}
|
||||
afflictionsCopy.Clear();
|
||||
afflictionsCopy.AddRange(afflictions);
|
||||
for (int i = afflictionsCopy.Count - 1; i >= 0; i--)
|
||||
{
|
||||
afflictionsCopy[i].ApplyStatusEffects(type, 1.0f, this, targetLimb: null);
|
||||
}
|
||||
}
|
||||
|
||||
public Pair<CauseOfDeathType, Affliction> GetCauseOfDeath()
|
||||
{
|
||||
List<Affliction> currentAfflictions = GetAllAfflictions(true);
|
||||
|
||||
Reference in New Issue
Block a user