Core/Spells: Set summoner guid for GO cast triggers to allow proper hostility checks on cast

This commit is contained in:
cyberbrest
2011-08-29 23:49:46 +02:00
committed by QAston
parent 2f79241237
commit 5708bc8b1e

View File

@@ -1631,6 +1631,8 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
if (Unit* owner = GetOwner())
{
trigger->setFaction(owner->getFaction());
// needed for GO casts for proper target validation checks
trigger->SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner->GetGUID());
trigger->CastSpell(target ? target : trigger, spellInfo, true, 0, 0, owner->GetGUID());
}
else