mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-21 07:11:59 -04:00
Core/Spells: Set summoner guid for GO cast triggers to allow proper hostility checks on cast
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user