mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01: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