mangosR2/mangos — Issue #454: error in creatureai
Author: Voidx
Created: 2011-10-22 05:26:41+00:00
State: open

````
CanCastResult CreatureAI::DoCastSpellIfCan(Unit* pTarget, uint32 uiSpell, uint32 uiCastFlags, ObjectGuid uiOriginalCasterGUID)
{
Unit* pCaster = m_creature;

if (uiCastFlags & CAST_FORCE_TARGET_SELF)
pCaster = pTarget;

if (!pTarget)
return CAST_FAIL_OTHER;

// Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered