mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[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:
parent
a72930acc9
commit
b435aa350f
5 changed files with 41 additions and 39 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include "CreatureAI.h"
|
||||
#include "Creature.h"
|
||||
#include "DBCStores.h"
|
||||
#include "Spell.h"
|
||||
|
||||
CreatureAI::~CreatureAI()
|
||||
{
|
||||
|
|
@ -46,7 +47,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry *pSpell,
|
|||
return CAST_FAIL_STATE;
|
||||
|
||||
// Check for power (also done by Spell::CheckCast())
|
||||
if (m_creature->GetPower((Powers)pSpell->powerType) < pSpell->manaCost)
|
||||
if (m_creature->GetPower((Powers)pSpell->powerType) < Spell::CalculatePowerCost(pSpell, m_creature))
|
||||
return CAST_FAIL_POWER;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue