aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-28 12:12:36 -0500
committermegamage <none@none>2009-06-28 12:12:36 -0500
commit70ac70208c84011324d449a6af8810f322a9cee7 (patch)
treeb2cfec00e967840a00991162f52a02021940bfce /src
parent3e079669860569990a179894b6861177fb1bef2d (diff)
*Fix a crash caused by spell 34665.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellEffects.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 2bbc38062a2..6f498b430ee 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -1180,33 +1180,15 @@ void Spell::EffectDummy(uint32 i)
}
case 34665: //Administer Antidote
{
- if(!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER )
+ if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT
+ || unitTarget->GetEntry() != 16880 || ((Creature*)unitTarget)->isPet())
return;
- if(!unitTarget)
- return;
-
- TempSummon* tempSummon = dynamic_cast<TempSummon*>(unitTarget);
- if(!tempSummon)
- return;
-
- uint32 health = tempSummon->GetHealth();
-
- 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);
+ ((Creature*)unitTarget)->UpdateEntry(16992);
+ ((Player*)m_caster)->RewardPlayerAndGroupAtEvent(16992, unitTarget);
- if (pCreature->IsAIEnabled)
- pCreature->AI()->AttackStart(m_caster);
+ if (unitTarget->IsAIEnabled)
+ ((Creature*)unitTarget)->AI()->AttackStart(m_caster);
return;
}