diff options
| author | raczman <none@none> | 2010-03-10 07:58:11 +0100 |
|---|---|---|
| committer | raczman <none@none> | 2010-03-10 07:58:11 +0100 |
| commit | 7fd1789109b1203fcc4c477012abacf4e1ed2b81 (patch) | |
| tree | 937bcf0ea4084d42f01a1daa043b009077357e5e /src | |
| parent | ac270db25165f7b7d2d32262cd794c5690962be4 (diff) | |
Totem* casts.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/SpellEffects.cpp | 4 | ||||
| -rw-r--r-- | src/game/SpellHandler.cpp | 2 | ||||
| -rw-r--r-- | src/game/TotemAI.cpp | 6 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 6 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 9a19e1ac8cd..e7df7ce656b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6966,7 +6966,7 @@ void Spell::EffectDestroyAllTotems(uint32 /*i*/) mana += spellInfo->manaCost; mana += spellInfo->ManaCostPercentage * m_caster->GetCreateMana() / 100; } - ((Totem*)totem)->UnSummon(); + totem->ToTotem()->UnSummon(); } } mana = mana * damage / 100; @@ -7430,7 +7430,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const * return; if (caster->isTotem()) - caster = ((Totem*)caster)->GetOwner(); + caster = caster->ToTotem()->GetOwner(); // in another case summon new uint8 level = caster->getLevel(); diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index c3edea12e8a..231d0c4e0b4 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -506,7 +506,7 @@ void WorldSession::HandleTotemDestroyed( WorldPacket& recvPacket) Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]); // Don't unsummon sentry totem if(totem && totem->isTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY) - ((Totem*)totem)->UnSummon(); + totem->ToTotem()->UnSummon(); } void WorldSession::HandleSelfResOpcode( WorldPacket & /*recv_data*/ ) diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp index 735906b44cc..25b40d9f7ee 100644 --- a/src/game/TotemAI.cpp +++ b/src/game/TotemAI.cpp @@ -56,14 +56,14 @@ void TotemAI::EnterEvadeMode() void TotemAI::UpdateAI(const uint32 /*diff*/) { - if (((Totem*)m_creature)->GetTotemType() != TOTEM_ACTIVE) + if ( m_creature->ToTotem()->GetTotemType() != TOTEM_ACTIVE) return; if (!m_creature->isAlive() || m_creature->IsNonMeleeSpellCasted(false)) return; // Search spell - SpellEntry const *spellInfo = sSpellStore.LookupEntry(((Totem*)m_creature)->GetSpell()); + SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_creature->ToTotem()->GetSpell()); if (!spellInfo) return; @@ -95,7 +95,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) // attack m_creature->SetInFront(victim); // client change orientation by self - m_creature->CastSpell(victim, ((Totem*)m_creature)->GetSpell(), false); + m_creature->CastSpell(victim, m_creature->ToTotem()->GetSpell(), false); } else i_victimGuid = 0; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 53b4d75b2f7..3c940b6a2de 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3736,8 +3736,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo // Remove totem at next update if totem looses its aura if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem()&& ((TempSummon*)this)->GetSummonerGUID() == aura->GetCasterGUID()) { - if (((Totem*)this)->GetSpell() == aura->GetId() && ((Totem*)this)->GetTotemType() == TOTEM_PASSIVE) - ((Totem*)this)->setDeathState(JUST_DIED); + if (this->ToTotem()->GetSpell() == aura->GetId() && this->ToTotem()->GetTotemType() == TOTEM_PASSIVE) + this->ToTotem()->setDeathState(JUST_DIED); } // Remove aurastates only if were not found @@ -9341,7 +9341,7 @@ void Unit::SetMinion(Minion *minion, bool apply) else if (minion->isTotem()) { // All summoned by totem minions must disappear when it is removed. - if (const SpellEntry* spInfo = sSpellStore.LookupEntry(((Totem*)minion)->GetSpell())) + if (const SpellEntry* spInfo = sSpellStore.LookupEntry(minion->ToTotem()->GetSpell())) for (int i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (spInfo->Effect[i] != SPELL_EFFECT_SUMMON) |
