Core/Spells: Add missing privateObjectOwner support to Spell::SummonGuardian
Port From (https://github.com/TrinityCore/TrinityCore/commit/46a81ea1f440b91611bc7b849ac09d523a041878)
This commit is contained in:
@@ -1124,7 +1124,7 @@ namespace Game.AI
|
|||||||
if (summoner == null)
|
if (summoner == null)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ObjectGuid privateObjectOwner;
|
ObjectGuid privateObjectOwner = ObjectGuid.Empty;
|
||||||
if (flags.HasAnyFlag(SmartActionSummonCreatureFlags.PersonalSpawn))
|
if (flags.HasAnyFlag(SmartActionSummonCreatureFlags.PersonalSpawn))
|
||||||
privateObjectOwner = summoner.IsPrivateObject() ? summoner.GetPrivateObjectOwner() : summoner.GetGUID();
|
privateObjectOwner = summoner.IsPrivateObject() ? summoner.GetPrivateObjectOwner() : summoner.GetGUID();
|
||||||
|
|
||||||
|
|||||||
@@ -1641,7 +1641,7 @@ namespace Game.Spells
|
|||||||
case SummonCategory.Unk:
|
case SummonCategory.Unk:
|
||||||
if (Convert.ToBoolean(properties.Flags & SummonPropFlags.Unk10))
|
if (Convert.ToBoolean(properties.Flags & SummonPropFlags.Unk10))
|
||||||
{
|
{
|
||||||
SummonGuardian(effIndex, entry, properties, numSummons);
|
SummonGuardian(effIndex, entry, properties, numSummons, privateObjectOwner);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (properties.Title)
|
switch (properties.Title)
|
||||||
@@ -1650,7 +1650,7 @@ namespace Game.Spells
|
|||||||
case SummonTitle.Guardian:
|
case SummonTitle.Guardian:
|
||||||
case SummonTitle.Runeblade:
|
case SummonTitle.Runeblade:
|
||||||
case SummonTitle.Minion:
|
case SummonTitle.Minion:
|
||||||
SummonGuardian(effIndex, entry, properties, numSummons);
|
SummonGuardian(effIndex, entry, properties, numSummons, privateObjectOwner);
|
||||||
break;
|
break;
|
||||||
// Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE)
|
// Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE)
|
||||||
case SummonTitle.Vehicle:
|
case SummonTitle.Vehicle:
|
||||||
@@ -1719,7 +1719,7 @@ namespace Game.Spells
|
|||||||
}//switch
|
}//switch
|
||||||
break;
|
break;
|
||||||
case SummonCategory.Pet:
|
case SummonCategory.Pet:
|
||||||
SummonGuardian(effIndex, entry, properties, numSummons);
|
SummonGuardian(effIndex, entry, properties, numSummons, privateObjectOwner);
|
||||||
break;
|
break;
|
||||||
case SummonCategory.Puppet:
|
case SummonCategory.Puppet:
|
||||||
summon = m_caster.GetMap().SummonCreature(entry, destTarget, properties, (uint)duration, m_originalCaster, m_spellInfo.Id, 0, privateObjectOwner);
|
summon = m_caster.GetMap().SummonCreature(entry, destTarget, properties, (uint)duration, m_originalCaster, m_spellInfo.Id, 0, privateObjectOwner);
|
||||||
@@ -2312,7 +2312,7 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(67);
|
SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(67);
|
||||||
if (properties != null)
|
if (properties != null)
|
||||||
SummonGuardian(effIndex, petentry, properties, 1);
|
SummonGuardian(effIndex, petentry, properties, 1, ObjectGuid.Empty);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4847,7 +4847,7 @@ namespace Game.Spells
|
|||||||
gameObjTarget.SetDestructibleState((GameObjectDestructibleState)effectInfo.MiscValue, player, true);
|
gameObjTarget.SetDestructibleState((GameObjectDestructibleState)effectInfo.MiscValue, player, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SummonGuardian(uint i, uint entry, SummonPropertiesRecord properties, uint numGuardians)
|
void SummonGuardian(uint i, uint entry, SummonPropertiesRecord properties, uint numGuardians, ObjectGuid privateObjectOwner)
|
||||||
{
|
{
|
||||||
Unit caster = m_originalCaster;
|
Unit caster = m_originalCaster;
|
||||||
if (caster == null)
|
if (caster == null)
|
||||||
@@ -4887,7 +4887,7 @@ namespace Game.Spells
|
|||||||
// randomize position for multiple summons
|
// randomize position for multiple summons
|
||||||
pos = m_caster.GetRandomPoint(destTarget, radius);
|
pos = m_caster.GetRandomPoint(destTarget, radius);
|
||||||
|
|
||||||
TempSummon summon = map.SummonCreature(entry, pos, properties, (uint)duration, caster, m_spellInfo.Id);
|
TempSummon summon = map.SummonCreature(entry, pos, properties, (uint)duration, caster, m_spellInfo.Id, 0, privateObjectOwner);
|
||||||
if (summon == null)
|
if (summon == null)
|
||||||
return;
|
return;
|
||||||
if (summon.HasUnitTypeMask(UnitTypeMask.Guardian))
|
if (summon.HasUnitTypeMask(UnitTypeMask.Guardian))
|
||||||
|
|||||||
Reference in New Issue
Block a user