aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-03-28 16:52:07 +0200
committerShauren <shauren.trinity@gmail.com>2024-10-05 17:03:55 +0200
commitb502bc46837f68383b68d8aecc4d4d5d7ff252f5 (patch)
treea551375554c44adb45880dff46f3e7ff5d74a600 /src/server/game/Spells/SpellEffects.cpp
parentcb9b34d906108146e6571d349abb8da3ea4a8c6f (diff)
Core/Objects: Pass privateObjectOwner guid directly to SummonCreature functions
(cherry picked from commit 33b3ebcae67870f704d86d30aa357781b33bb411)
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp12
1 files changed, 7 insertions, 5 deletions
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: