diff options
Diffstat (limited to 'src/game/Pet.cpp')
-rw-r--r-- | src/game/Pet.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 0c254bc9eb7..070de6e5899 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -63,7 +63,7 @@ Pet::~Pet() if(GetOwnerGUID()) sLog.outCrash("Pet %u is deconstructed but it still has owner guid", GetEntry()); - for (PetSpellMap::iterator i = m_spells.begin(); i != m_spells.end(); ++i) + for (PetSpellMap::const_iterator i = m_spells.begin(); i != m_spells.end(); ++i) delete i->second; } @@ -449,14 +449,14 @@ void Pet::SavePetToDB(PetSaveMode mode) << curmana << ", " << GetPower(POWER_HAPPINESS) << ", '"; - for(uint32 i = 0; i < 10; i++) + for(uint32 i = 0; i < 10; ++i) ss << uint32(m_charmInfo->GetActionBarEntry(i)->Type) << " " << uint32(m_charmInfo->GetActionBarEntry(i)->SpellOrAction) << " "; ss << "', '"; //save spells the pet can teach to it's Master { int i = 0; - for(TeachSpellMap::iterator itr = m_teachspells.begin(); i < 4 && itr != m_teachspells.end(); ++i, ++itr) + for(TeachSpellMap::const_iterator itr = m_teachspells.begin(); i < 4 && itr != m_teachspells.end(); ++i, ++itr) ss << itr->first << " " << itr->second << " "; for(; i < 4; ++i) ss << uint32(0) << " " << uint32(0) << " "; @@ -642,7 +642,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid) chainstartstore[0] = spellmgr.GetFirstSpellInChain(spellid); - for (PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) + for (PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) { if(IsPassiveSpell(itr->first)) continue; @@ -1275,7 +1275,7 @@ bool Pet::addSpell(uint32 spell_id, uint16 active, PetSpellState state, PetSpell } else if(uint32 chainstart = spellmgr.GetFirstSpellInChain(spell_id)) { - for (PetSpellMap::iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) + for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { if(itr2->second->state == PETSPELL_REMOVED) continue; @@ -1409,7 +1409,7 @@ void Pet::InitPetCreateSpells() { m_charmInfo->InitPetActionBar(); - for (PetSpellMap::iterator i = m_spells.begin(); i != m_spells.end(); ++i) + for (PetSpellMap::const_iterator i = m_spells.begin(); i != m_spells.end(); ++i) delete i->second; m_spells.clear(); @@ -1417,7 +1417,7 @@ void Pet::InitPetCreateSpells() PetCreateSpellEntry const* CreateSpells = objmgr.GetPetCreateSpellEntry(GetEntry()); if(CreateSpells) { - for(uint8 i = 0; i < 4; i++) + for(uint8 i = 0; i < 4; ++i) { if(!CreateSpells->spellid[i]) break; @@ -1510,7 +1510,7 @@ bool Pet::resetTalents(bool no_cost) } } - for (unsigned int i = 0; i < sTalentStore.GetNumRows(); i++) + for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) { TalentEntry const *talentInfo = sTalentStore.LookupEntry(i); @@ -1527,7 +1527,7 @@ bool Pet::resetTalents(bool no_cost) for (int j = 0; j < MAX_TALENT_RANK; j++) { - for(PetSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();) + for(PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end();) { if(itr->second->state == PETSPELL_REMOVED) { @@ -1617,7 +1617,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply) if(apply) { - for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++) + for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; ++i) ; // just search if (i == m_autospells.size()) @@ -1630,7 +1630,7 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply) else { AutoSpellList::iterator itr2 = m_autospells.begin(); - for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; i++, itr2++) + for (i = 0; i < m_autospells.size() && m_autospells[i] != spellid; ++i, itr2++) ; // just search if (i < m_autospells.size()) @@ -1698,7 +1698,7 @@ void Pet::CastPetAuras(bool current) if(getPetType() != HUNTER_PET && (getPetType() != SUMMON_PET || owner->getClass() != CLASS_WARLOCK)) return; - for(PetAuraSet::iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end();) + for(PetAuraSet::const_iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end();) { PetAura const* pa = *itr; ++itr; |