CL_Fix Use TryAdd when adding afflictions to dictionary
Replaces afflictions.Add with afflictions.TryAdd to prevent exceptions if the affliction already exists in the dictionary.
This commit is contained in:
@@ -2143,7 +2143,7 @@ namespace Barotrauma
|
||||
if (existingAffliction == null)
|
||||
{
|
||||
existingAffliction = afflictionPrefab.Instantiate(strength);
|
||||
afflictions.Add(existingAffliction, limb);
|
||||
afflictions.TryAdd(existingAffliction, limb);
|
||||
newAdded = true;
|
||||
}
|
||||
existingAffliction.SetStrength(strength);
|
||||
|
||||
Reference in New Issue
Block a user