Core/Spells: Fix cloning spells

Closes #1162
This commit is contained in:
ille
2011-04-08 23:16:57 +03:00
committed by Shocker
parent 5f4337f7e9
commit a2bcb9425c
2 changed files with 50 additions and 8 deletions
@@ -3448,14 +3448,17 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const * aurApp, uint8 mod
if (apply)
{
Unit * caster = GetCaster();
if (!caster)
if (!caster || caster == target)
return;
// Set display id (probably for portrait?)
// What must be cloned? at least display and scale
target->SetDisplayId(caster->GetDisplayId());
target->SetCreatorGUID(caster->GetGUID());
//target->SetFloatValue(OBJECT_FIELD_SCALE_X, caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?)
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
}
else
{
target->SetCreatorGUID(0);
target->SetDisplayId(target->GetNativeDisplayId());
target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
}