[11447] Make SPELL_AURA_MIRROR_IMAGE work also for TARGET_SCRIPT

Not the best solution though, and should figure out a more nice way to deal with it.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-05-08 23:05:06 +02:00
parent 605fb79847
commit 8ee769a3cd
2 changed files with 6 additions and 2 deletions

View file

@ -5535,10 +5535,14 @@ SpellCastResult Spell::CheckCast(bool strict)
{ {
Unit* pTarget = m_targets.getUnitTarget(); Unit* pTarget = m_targets.getUnitTarget();
// In case of TARGET_SCRIPT, we have already added a target. Use it here (and find a better solution)
if (m_UniqueTargetInfo.size() == 1)
pTarget = m_caster->GetMap()->GetAnyTypeCreature(m_UniqueTargetInfo.front().targetGUID);
if (!pTarget) if (!pTarget)
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
if (pTarget->GetTypeId() != TYPEID_UNIT) // Target must be creature if (pTarget->GetTypeId() != TYPEID_UNIT) // Target must be creature. TODO: Check if target can also be player
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
if (pTarget == m_caster) // Clone self can't be accepted if (pTarget == m_caster) // Clone self can't be accepted

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11446" #define REVISION_NR "11447"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__