[10701] Correct check percent spell costs in AI::CanCast

Also use uint32 for spell cost fields/results

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
kid 10 2010-11-08 22:04:50 +03:00 committed by VladimirMangos
parent a72930acc9
commit b435aa350f
5 changed files with 41 additions and 39 deletions

View file

@ -1390,7 +1390,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge
return false;
//Check for power
if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell->manaCost)
if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell::CalculatePowerCost(Spell, m_creature))
return false;
SpellRangeEntry const *TempRange = NULL;