aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-10-27 12:14:54 +0200
committerShauren <shauren.trinity@gmail.com>2018-10-27 12:14:54 +0200
commitbbdf62d6e84a47036e39a59a1349c073711ec2ca (patch)
tree06c79ff70d1bc426497a128a096dffd1b44476f4 /src
parentee68cf33921944fd3f8c188044906998cf10ff2a (diff)
Core/Spells: Warning fix
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp2
-rw-r--r--src/server/game/Spells/Spell.cpp6
-rw-r--r--src/server/game/Spells/SpellInfo.cpp6
-rw-r--r--src/server/game/Spells/SpellInfo.h2
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index d57dc6c4c24..f9f70d5a9f7 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -310,7 +310,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
continue;
//Continue if we don't have the mana to actually cast this spell
- if (tempSpell->ManaCost > me->GetPower(Powers(tempSpell->PowerType)))
+ if (tempSpell->ManaCost > me->GetPower(tempSpell->PowerType))
continue;
//Check if the spell meets our range requirements
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 98bdfd7ce8c..b36a014d509 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4129,7 +4129,7 @@ void Spell::SendSpellStart()
m_targets.Write(castData.Target);
if (castFlags & CAST_FLAG_POWER_LEFT_SELF)
- castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(static_cast<Powers>(m_spellInfo->PowerType));
+ castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(m_spellInfo->PowerType);
if (castFlags & CAST_FLAG_AMMO)
{
@@ -4205,7 +4205,7 @@ void Spell::SendSpellGo()
m_targets.Write(castData.Target);
if (castFlags & CAST_FLAG_POWER_LEFT_SELF)
- castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(static_cast<Powers>(m_spellInfo->PowerType));
+ castData.RemainingPower = ASSERT_NOTNULL(m_caster->ToUnit())->GetPower(m_spellInfo->PowerType);
if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list
{
@@ -6402,7 +6402,7 @@ SpellCastResult Spell::CheckPower() const
}
// Check power amount
- Powers powerType = Powers(m_spellInfo->PowerType);
+ Powers powerType = m_spellInfo->PowerType;
if (int32(unitCaster->GetPower(powerType)) < m_powerCost)
return SPELL_FAILED_NO_POWER;
else
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 4eab08185a9..64483f03e76 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -809,7 +809,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
BaseLevel = spellEntry->baseLevel;
SpellLevel = spellEntry->spellLevel;
DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : nullptr;
- PowerType = spellEntry->powerType;
+ PowerType = static_cast<Powers>(spellEntry->powerType);
ManaCost = spellEntry->manaCost;
ManaCostPerlevel = spellEntry->manaCostPerlevel;
ManaPerSecond = spellEntry->manaPerSecond;
@@ -3162,7 +3162,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school
return unitCaster->GetHealth();
// Else drain all power
if (PowerType < MAX_POWERS)
- return unitCaster->GetPower(Powers(PowerType));
+ return unitCaster->GetPower(PowerType);
TC_LOG_ERROR("spells", "SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id);
return 0;
}
@@ -3185,7 +3185,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school
case POWER_FOCUS:
case POWER_ENERGY:
case POWER_HAPPINESS:
- powerCost += int32(CalculatePct(unitCaster->GetMaxPower(Powers(PowerType)), ManaCostPercentage));
+ powerCost += int32(CalculatePct(unitCaster->GetMaxPower(PowerType), ManaCostPercentage));
break;
case POWER_RUNE:
case POWER_RUNIC_POWER:
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 5870d948f5c..601ccf59f36 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -366,7 +366,7 @@ class TC_GAME_API SpellInfo
uint32 BaseLevel;
uint32 SpellLevel;
SpellDurationEntry const* DurationEntry;
- uint32 PowerType;
+ Powers PowerType;
uint32 ManaCost;
uint32 ManaCostPerlevel;
uint32 ManaPerSecond;
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index fec2f78696b..a5a9f4d33e4 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3124,7 +3124,7 @@ void SpellMgr::LoadSpellInfoCorrections()
// Detect Undead
ApplySpellFix({ 11389 }, [](SpellInfo* spellInfo)
{
- spellInfo->PowerType = 0;
+ spellInfo->PowerType = POWER_MANA;
spellInfo->ManaCost = 0;
spellInfo->ManaPerSecond = 0;
});