aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-11-12 02:42:06 +0100
committerShauren <shauren.trinity@gmail.com>2017-11-12 02:42:06 +0100
commit331c70e695c6eef085be03a4f149158b68470035 (patch)
tree57c9ef3800b6fe544198d0070c55aeb615656b64 /src/server/scripts/Spells
parentbf0ae32d189d4579920e027f9d2dbfacc5552df3 (diff)
Core/Players: Fixed DK runes and runic power
Closes #19595
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 0edaa189e8e..a12305168c2 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -91,11 +91,12 @@ public:
{
if (Unit* caster = eventInfo.GetActor())
{
- if (caster->GetTypeId() != TYPEID_PLAYER || caster->getClass() != CLASS_DEATH_KNIGHT)
+ Player* player = caster->ToPlayer();
+ if (!player || caster->getClass() != CLASS_DEATH_KNIGHT)
return false;
- for (uint8 i = 0; i < MAX_RUNES; ++i)
- if (caster->ToPlayer()->GetRuneCooldown(i) == 0)
+ for (uint8 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
+ if (player->GetRuneCooldown(i) == 0)
return false;
return true;