mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 14:10:18 -04:00
Core/Objects: Use player as summoner for personal clones (#27716)
* This allows clones to properly inherit phases
This commit is contained in:
@@ -2531,12 +2531,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
WorldObject* baseObject = GetBaseObject();
|
||||
|
||||
auto doCreatePersonalClone = [&](Position const& position, Unit* owner)
|
||||
auto doCreatePersonalClone = [&](Position const& position, Player* privateObjectOwner)
|
||||
{
|
||||
ObjectGuid privateObjectOwner = owner->GetGUID();
|
||||
if (Creature* summon = GetBaseObject()->SummonPersonalClone(position, TempSummonType(e.action.becomePersonalClone.type), Milliseconds(e.action.becomePersonalClone.duration), 0, 0, privateObjectOwner))
|
||||
if (IsSmart(summon))
|
||||
ENSURE_AI(SmartAI, summon->AI())->SetTimedActionList(e, e.entryOrGuid, owner, e.event_id + 1);
|
||||
ENSURE_AI(SmartAI, summon->AI())->SetTimedActionList(e, e.entryOrGuid, privateObjectOwner, e.event_id + 1);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user