From b502bc46837f68383b68d8aecc4d4d5d7ff252f5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 28 Mar 2021 16:52:07 +0200 Subject: Core/Objects: Pass privateObjectOwner guid directly to SummonCreature functions (cherry picked from commit 33b3ebcae67870f704d86d30aa357781b33bb411) --- src/server/game/Spells/SpellEffects.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/server/game/Spells/SpellEffects.cpp') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 423883689d7..0071823ed6e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2038,7 +2038,9 @@ void Spell::EffectSummonType() if (m_originalCaster) caster = m_originalCaster; - bool personalSpawn = (properties->Flags & SUMMON_PROP_FLAG_PERSONAL_SPAWN) != 0; + ObjectGuid privateObjectOwner; + if (properties->Flags & SUMMON_PROP_FLAG_PERSONAL_SPAWN) + privateObjectOwner = m_originalCaster->IsPrivateObject() ? m_originalCaster->GetPrivateObjectOwner() : m_originalCaster->GetGUID(); int32 duration = m_spellInfo->GetDuration(); if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); @@ -2114,7 +2116,7 @@ void Spell::EffectSummonType() if (!unitCaster) return; - summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, personalSpawn); + summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, privateObjectOwner); if (!summon || !summon->IsTotem()) return; @@ -2134,7 +2136,7 @@ void Spell::EffectSummonType() if (!unitCaster) return; - summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, personalSpawn); + summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, privateObjectOwner); if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; @@ -2158,7 +2160,7 @@ void Spell::EffectSummonType() // randomize position for multiple summons pos = caster->GetRandomPoint(*destTarget, radius); - summon = caster->SummonCreature(entry, pos, summonType, Milliseconds(duration), 0, m_spellInfo->Id, personalSpawn); + summon = caster->SummonCreature(entry, pos, summonType, Milliseconds(duration), 0, m_spellInfo->Id, privateObjectOwner); if (!summon) continue; @@ -2183,7 +2185,7 @@ void Spell::EffectSummonType() if (!unitCaster) return; - summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, personalSpawn); + summon = unitCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, unitCaster, m_spellInfo->Id, 0, privateObjectOwner); break; } case SUMMON_CATEGORY_VEHICLE: -- cgit v1.2.3