diff options
author | Azrael <none@none> | 2009-07-11 13:33:32 +0200 |
---|---|---|
committer | Azrael <none@none> | 2009-07-11 13:33:32 +0200 |
commit | 024bde5fe76c32c537508352b002ff688a8a551b (patch) | |
tree | b30fd30a72632ddbc63c8088557a113c235b0f2d /src | |
parent | 4dc5242a6939fd172ea7bfb293125de51f654e5b (diff) |
*Cleanups in typecasts in spelleffects.cpp
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellEffects.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3294c32bde8..8dc2e696da1 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -743,14 +743,11 @@ void Spell::EffectDummy(uint32 i) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->isPet()) return; - Creature* creatureTarget = (Creature*)unitTarget; GameObject* pGameObj = new GameObject; - if (!creatureTarget || !pGameObj) return; - - if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, creatureTarget->GetMap(), creatureTarget->GetPhaseMask(), - creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), - creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY)) + if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, unitTarget->GetMap(), unitTarget->GetPhaseMask(), + unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), + unitTarget->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY)) { delete pGameObj; return; @@ -761,7 +758,7 @@ void Spell::EffectDummy(uint32 i) //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); pGameObj->SetSpellId(m_spellInfo->Id); - MapManager::Instance().GetMap(creatureTarget->GetMapId(), pGameObj)->Add(pGameObj); + MapManager::Instance().GetMap(unitTarget->GetMapId(), pGameObj)->Add(pGameObj); WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8); data << uint64(pGameObj->GetGUID()); @@ -907,9 +904,7 @@ void Spell::EffectDummy(uint32 i) if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; - Creature* creatureTarget = (Creature*)unitTarget; - - creatureTarget->ForcedDespawn(); + ((Creature*)unitTarget)->ForcedDespawn(); return; } case 16589: // Noggenfogger Elixir @@ -961,8 +956,6 @@ void Spell::EffectDummy(uint32 i) return; Creature* creatureTarget = (Creature*)unitTarget; - if(creatureTarget->isPet()) - return; GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-time(NULL)); sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); @@ -1183,9 +1176,7 @@ void Spell::EffectDummy(uint32 i) if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; - Creature* creatureTarget = (Creature*)unitTarget; - - creatureTarget->ForcedDespawn(); + ((Creature*)unitTarget)->ForcedDespawn(); //cast spell Raptor Capture Credit m_caster->CastSpell(m_caster, 42337, true, NULL); @@ -1254,9 +1245,7 @@ void Spell::EffectDummy(uint32 i) if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; - Creature* creatureTarget = (Creature*)unitTarget; - - creatureTarget->ForcedDespawn(); + ((Creature*)unitTarget)->ForcedDespawn(); return; } @@ -4056,7 +4045,7 @@ void Spell::EffectTameCreature(uint32 /*i*/) if(!unitTarget) return; - if(unitTarget->GetTypeId() == TYPEID_PLAYER) + if(unitTarget->GetTypeId() != TYPEID_UNIT) return; Creature* creatureTarget = (Creature*)unitTarget; |