Core/GameObject: Hunter traps now always put the Hunter in combat with the target when triggered. Closes #21847.

This commit is contained in:
Treeston
2018-07-24 21:15:06 +02:00
parent 15ab24756d
commit 5df7ffaf84
2 changed files with 5 additions and 1 deletions

View File

@@ -692,6 +692,10 @@ void GameObject::Update(uint32 diff)
}
else if (Unit* target = ObjectAccessor::GetUnit(*this, m_lootStateUnitGUID))
{
// Set in combat with owner
if (Unit* owner = GetOwner())
target->EngageWithTarget(owner);
// Some traps do not have a spell but should be triggered
CastSpellExtraArgs args;
args.SetOriginalCaster(GetOwnerGUID());

View File

@@ -78,7 +78,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript
}
// Redefined for random target selection:
void MoveInLineOfSight(Unit* who) override { }
void MoveInLineOfSight(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{