Skip to content

Commit

Permalink
1.7.2 | Check activeItems before adding them for SCP-268
Browse files Browse the repository at this point in the history
  • Loading branch information
Vretu-Dev committed Oct 16, 2024
1 parent 194b356 commit 5b6f1c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions UsefulHints/EventHandlers/Items/Hints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion UsefulHints/UsefulHints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class UsefulHints : Plugin<Config>
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; }
Expand Down

0 comments on commit 5b6f1c1

Please sign in to comment.