StatusEffect.StopAll clears DurationList and DelayList. Closes #543

This commit is contained in:
Joonas Rikkonen
2018-07-30 20:02:56 +03:00
parent 86df5f6b1a
commit 13a2e4d33b
2 changed files with 4 additions and 2 deletions
@@ -13,7 +13,7 @@ namespace Barotrauma
} }
class DelayedEffect : StatusEffect class DelayedEffect : StatusEffect
{ {
public static List<DelayedListElement> DelayList = new List<DelayedListElement>(); public static readonly List<DelayedListElement> DelayList = new List<DelayedListElement>();
private float delay; private float delay;
@@ -50,7 +50,7 @@ namespace Barotrauma
private HashSet<string> tags; private HashSet<string> tags;
private readonly float duration; private readonly float duration;
public static List<DurationListElement> DurationList = new List<DurationListElement>(); public static readonly List<DurationListElement> DurationList = new List<DurationListElement>();
public bool CheckConditionalAlways; //Always do the conditional checks for the duration/delay. If false, only check conditional on apply. public bool CheckConditionalAlways; //Always do the conditional checks for the duration/delay. If false, only check conditional on apply.
@@ -510,6 +510,8 @@ namespace Barotrauma
public static void StopAll() public static void StopAll()
{ {
CoroutineManager.StopCoroutines("statuseffect"); CoroutineManager.StopCoroutines("statuseffect");
DelayedEffect.DelayList.Clear();
DurationList.Clear();
} }
public void AddTag(string tag) public void AddTag(string tag)