aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeader <keader.android@gmail.com>2018-04-03 08:28:41 -0300
committerShauren <shauren.trinity@gmail.com>2021-09-23 23:50:13 +0200
commit69663cc94f8b90daa5f19192313d4c4129ba64cc (patch)
treef38e297beb03f4662d5ce299634e5f124dbed6e7 /src
parent3ea88f814a6be7487ef8a3d5c6237981d20f5063 (diff)
Core/Spells: Fix UNIT_CREATED_BY_SPELL in SPELL_EFFECT_SUMMON (#21756)
(cherry picked from commit 309738dc3e08f572fad661e96f149a017011758c)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Object/Object.cpp7
-rw-r--r--src/server/game/Entities/Object/Object.h4
-rw-r--r--src/server/game/Spells/SpellEffects.cpp3
3 files changed, 6 insertions, 8 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index bf6827d4967..0dea9b378d8 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -1875,11 +1875,11 @@ Scenario* WorldObject::GetScenario() const
return nullptr;
}
-TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 despawnTime /*= 0*/, uint32 vehId /*= 0*/, ObjectGuid privateObjectOwner /* = ObjectGuid::Empty */)
+TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 despawnTime /*= 0*/, uint32 vehId /*= 0*/, uint32 spellId /*= 0*/, ObjectGuid privateObjectOwner /* = ObjectGuid::Empty */)
{
if (Map* map = FindMap())
{
- if (TempSummon* summon = map->SummonCreature(entry, pos, nullptr, despawnTime, ToUnit(), 0, vehId, privateObjectOwner))
+ if (TempSummon* summon = map->SummonCreature(entry, pos, nullptr, despawnTime, ToUnit(), spellId, vehId, privateObjectOwner))
{
summon->SetTempSummonType(despawnType);
return summon;
@@ -1895,7 +1895,7 @@ TempSummon* WorldObject::SummonCreature(uint32 id, float x, float y, float z, fl
GetClosePoint(x, y, z, GetCombatReach());
if (!o)
o = GetOrientation();
- return SummonCreature(id, { x,y,z,o }, despawnType, despawnTime, 0, privateObjectOwner);
+ return SummonCreature(id, { x,y,z,o }, despawnType, despawnTime, 0, 0, privateObjectOwner);
}
GameObject* WorldObject::SummonGameObject(uint32 entry, Position const& pos, QuaternionData const& rot, uint32 respawnTime, GOSummonType summonType)
@@ -3005,7 +3005,6 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
{
GetNearPoint2D(searcher, x, y, distance2d, absAngle);
z = GetPositionZ();
-
(searcher ? searcher : this)->UpdateAllowedPositionZ(x, y, z);
// if detection disabled, return first point
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index f311cfd23d3..3a51700cc63 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -541,8 +541,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
Scenario* GetScenario() const;
- TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty);
- TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, privateObjectOwner); }
+ TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty);
+ TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0, uint32 spellId = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId, privateObjectOwner); }
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, ObjectGuid privateObjectOwner = ObjectGuid::Empty);
GameObject* SummonGameObject(uint32 entry, Position const& pos, QuaternionData const& rot, uint32 respawnTime /* s */, GOSummonType summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN);
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, QuaternionData const& rot, uint32 respawnTime /* s */);
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d646405b360..b9137c8ab91 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2002,7 +2002,7 @@ void Spell::EffectSummonType()
// randomize position for multiple summons
pos = caster->GetRandomPoint(*destTarget, radius);
- summon = caster->SummonCreature(entry, pos, summonType, duration, 0, privateObjectOwner);
+ summon = caster->SummonCreature(entry, pos, summonType, duration, 0, m_spellInfo->Id, privateObjectOwner);
if (!summon)
continue;
@@ -2010,7 +2010,6 @@ void Spell::EffectSummonType()
{
summon->SetOwnerGUID(caster->GetGUID());
summon->SetFaction(caster->GetFaction());
- summon->SetCreatedBySpell(m_spellInfo->Id);
}
ExecuteLogEffectSummonObject(SpellEffectName(effectInfo->Effect), summon);