Skip to content

Commit

Permalink
fix multiple problems in GetSpellRemainingCooldown (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheshire92 authored Sep 19, 2023
1 parent fa8b808 commit 9b187bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Intersect.Client/Entities/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,14 @@ public bool IsSpellOnCooldown(int slot)

public long GetSpellRemainingCooldown(int slot)
{
if (Spells[slot] != null)
var spl = Spells[slot];
if (spl != null)
{
var spl = Spells[slot];
if (spl.Id != Guid.Empty)
{
if (SpellCooldowns.ContainsKey(spl.Id) && SpellCooldowns[spl.Id] > Timing.Global.Milliseconds)
if (SpellCooldowns.TryGetValue(spl.Id, out var cd) && cd > Timing.Global.Milliseconds)
{
return ItemCooldowns[spl.Id] - Timing.Global.Milliseconds;
return cd - Timing.Global.Milliseconds;
}
else if ((SpellBase.TryGet(spl.Id, out var spellBase) && !spellBase.IgnoreGlobalCooldown) && Globals.Me.GlobalCooldown > Timing.Global.Milliseconds)
{
Expand Down

0 comments on commit 9b187bd

Please sign in to comment.