From 2d2a9eac1622c7f3cccff8c152f0c59ec3199153 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 9 Jun 2018 12:02:06 -0400 Subject: [PATCH] Core/Player: Fixed cooldowns of DK Runes. --- Source/Game/Entities/Player/Player.Fields.cs | 8 ++++---- Source/Game/Entities/Player/Player.Spells.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Fields.cs b/Source/Game/Entities/Player/Player.Fields.cs index 25c3dd50a..6834742cb 100644 --- a/Source/Game/Entities/Player/Player.Fields.cs +++ b/Source/Game/Entities/Player/Player.Fields.cs @@ -337,17 +337,17 @@ namespace Game.Entities { public void SetRuneState(byte index, bool set = true) { - var id = CooldownOrder.LookupByIndex(index); + bool foundRune = CooldownOrder.Contains(index); if (set) { RuneState |= (byte)(1 << index); // usable - if (id != 0) - CooldownOrder.RemoveAt(index); + if (foundRune) + CooldownOrder.Remove(index); } else { RuneState &= (byte)~(1 << index); // on cooldown - if (id == 0) + if (!foundRune) CooldownOrder.Add(index); } } diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index 3afe5c43d..3fd469069 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -17,12 +17,13 @@ using Framework.Constants; using Framework.Dynamic; +using Game.BattlePets; using Game.DataStorage; using Game.Network.Packets; using Game.Spells; using System; using System.Collections.Generic; -using Game.BattlePets; +using System.Linq; namespace Game.Entities { @@ -1818,7 +1819,6 @@ namespace Game.Entities m_spells.Remove(spellId); } - public void UpdateZoneDependentAuras(uint newZone) { // Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone.area update @@ -2865,9 +2865,9 @@ namespace Game.Entities { m_runes.Cooldown[index] = cooldown; m_runes.SetRuneState(index, (cooldown == 0) ? true : false); - uint activeRunes = m_runes.Cooldown[Math.Min(GetMaxPower(PowerType.Runes), (int)PowerType.Max)]; + int activeRunes = m_runes.Cooldown.Count(p => p == 0); if (activeRunes != GetPower(PowerType.Runes)) - SetPower(PowerType.Runes, (int)activeRunes); + SetPower(PowerType.Runes, activeRunes); } public byte GetRunesState()