Merge pull request #16193 from Goatform/3.3.5

Core/GameObjects: Fixed an issue where traps were not redirected to Grounding Totem
(cherry picked from commit 2a50ea5cf1)
This commit is contained in:
jackpoz
2016-01-07 19:27:40 +01:00
committed by Carbenium
parent ea2c2c9763
commit 06fdcb9e18

View File

@@ -1854,6 +1854,8 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, bool triggered /*= true
if (Unit* owner = GetOwner())
{
trigger->setFaction(owner->getFaction());
if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID());
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, owner->GetGUID());