diff options
author | Keader <keader.android@gmail.com> | 2018-04-03 08:28:41 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 08:28:41 -0300 |
commit | 309738dc3e08f572fad661e96f149a017011758c (patch) | |
tree | 992ab9909b4ebd5ef3b96a07a0093453d9be03b6 /src | |
parent | 6dd23da9e16230ba79994185843f7e75affdc248 (diff) |
Core/Spells: Fix UNIT_CREATED_BY_SPELL in SPELL_EFFECT_SUMMON (#21756)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 4 | ||||
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 1260817789b..e196923dab5 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1998,11 +1998,11 @@ void WorldObject::ClearZoneScript() m_zoneScript = nullptr; } -TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 despawnTime /*= 0*/, uint32 /*vehId = 0*/) +TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType /*= TEMPSUMMON_MANUAL_DESPAWN*/, uint32 despawnTime /*= 0*/, uint32 /*vehId = 0*/, uint32 spellId /*= 0*/) { if (Map* map = FindMap()) { - if (TempSummon* summon = map->SummonCreature(entry, pos, nullptr, despawnTime, ToUnit())) + if (TempSummon* summon = map->SummonCreature(entry, pos, nullptr, despawnTime, ToUnit(), spellId)) { summon->SetTempSummonType(despawnType); return summon; @@ -3152,7 +3152,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 2cb0583cf38..20422d985f1 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -385,8 +385,8 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation void ClearZoneScript(); ZoneScript* GetZoneScript() const { return m_zoneScript; } - TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0); - TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId); } + TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0); + TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0, uint32 spellId = 0) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId); } TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0); 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 269dc5527c9..24e33258d58 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2302,7 +2302,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // randomize position for multiple summons pos = caster->GetRandomPoint(*destTarget, radius); - summon = caster->SummonCreature(entry, pos, summonType, duration); + summon = caster->SummonCreature(entry, pos, summonType, duration, 0, m_spellInfo->Id); if (!summon) continue; @@ -2310,7 +2310,6 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) { summon->SetOwnerGUID(caster->GetGUID()); summon->SetFaction(caster->GetFaction()); - summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); } ExecuteLogEffectSummonObject(effIndex, summon); |