diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 14d6f5a06..5d39fab2b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1042,32 +1042,25 @@ void Spell::EffectDummy(uint32 i) { if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER ) return; - - if(!unitTarget) + // Spell has scriptable target but for sure. + if (unitTarget->GetTypeId() != TYPEID_UNIT) return; - TemporarySummon* tempSummon = dynamic_cast(unitTarget); - if(!tempSummon) - return; + uint32 health = unitTarget->GetHealth(); + float x, y, z, o; - uint32 health = tempSummon->GetHealth(); + unitTarget->GetPosition(x, y, z); + o = unitTarget->GetOrientation(); + ((Creature*)unitTarget)->ForcedDespawn(); - float x = tempSummon->GetPositionX(); - float y = tempSummon->GetPositionY(); - float z = tempSummon->GetPositionZ(); - float o = tempSummon->GetOrientation(); - tempSummon->UnSummon(); - - Creature* pCreature = m_caster->SummonCreature(16992, x, y, z, o,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,180000); - if (!pCreature) - return; - - pCreature->SetHealth(health); - ((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992, pCreature); - - if (pCreature->AI()) - pCreature->AI()->AttackStart(m_caster); + if (Creature* summon = m_caster->SummonCreature(16992, x, y, z, o,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,180000)) + { + summon->SetHealth(health); + ((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992, summon); + if (summon->AI()) + summon->AI()->AttackStart(m_caster); + } return; } case 44997: // Converting Sentry diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6ee17294e..93c4b523a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8095" + #define REVISION_NR "8096" #endif // __REVISION_NR_H__