diff --git a/UsefulHints/EventHandlers/Items/Hints.cs b/UsefulHints/EventHandlers/Items/Hints.cs index a5cdfa2..bf83770 100644 --- a/UsefulHints/EventHandlers/Items/Hints.cs +++ b/UsefulHints/EventHandlers/Items/Hints.cs @@ -91,9 +91,9 @@ private static void OnSCP1576Used(UsedItemEventArgs ev) { if (ev.Item.Type == ItemType.SCP1576) { - if (activeCoroutines.TryGetValue(ev.Player, out var existingCoroutine)) + if (activeCoroutines.ContainsKey(ev.Player)) { - Timing.KillCoroutines(existingCoroutine); + Timing.KillCoroutines(activeCoroutines[ev.Player]); activeCoroutines.Remove(ev.Player); } if (activeItems.ContainsKey(ev.Player)) @@ -137,6 +137,10 @@ private static void OnSCP268Used(UsedItemEventArgs ev) Timing.KillCoroutines(activeCoroutines[ev.Player]); activeCoroutines.Remove(ev.Player); } + if (activeItems.ContainsKey(ev.Player)) + { + activeItems.Remove(ev.Player); + } var coroutine = Timing.RunCoroutine(Scp268Timer(ev.Player)); activeCoroutines.Add(ev.Player, coroutine); diff --git a/UsefulHints/UsefulHints.cs b/UsefulHints/UsefulHints.cs index 59555ab..6c5cb42 100644 --- a/UsefulHints/UsefulHints.cs +++ b/UsefulHints/UsefulHints.cs @@ -9,7 +9,7 @@ public class UsefulHints : Plugin public override string Name => "Useful Hints"; public override string Author => "Vretu"; public override string Prefix { get; } = "UH"; - public override Version Version => new Version(1, 7, 1); + public override Version Version => new Version(1, 7, 2); public override Version RequiredExiledVersion { get; } = new Version(8, 9, 8); public override PluginPriority Priority { get; } = PluginPriority.Low; public static UsefulHints Instance { get; private set; }