aboutsummaryrefslogtreecommitdiff
path: root/src/game/Pet.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-31 10:21:57 +0800
committermegamage <none@none>2009-07-31 10:21:57 +0800
commit2bddcc4303060a42e88a0478005c3c0368e3569a (patch)
tree71becbc82b5bd711bd8699ad1cfb413e4f750fdc /src/game/Pet.cpp
parent4abac06cf0f16e576fe814ad52905c62acf5f0ba (diff)
[8251] Store in some DB tables only data for first rank. Author: VladimirMangos
* Allow add to DB data only for first rank in table `mangos_spell_bonus_data` and `mangos_spell_proc_event`. * Copy data for other ranks for speedup use at loading for this data and data from `spell_proc_item_enchant`. --HG-- branch : trunk
Diffstat (limited to 'src/game/Pet.cpp')
-rw-r--r--src/game/Pet.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 4071cfb50bb..6a7d809da03 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -1858,12 +1858,19 @@ void Pet::CastPetAura(PetAura const* aura)
CastSpell(this, auraId, true);
}
+struct DoPetLearnSpell
+{
+ DoPetLearnSpell(Pet& _pet) : pet(_pet) {}
+ void operator() (uint32 spell_id) { pet.learnSpell(spell_id); }
+ Pet& pet;
+};
+
void Pet::learnSpellHighRank(uint32 spellid)
{
learnSpell(spellid);
- if(uint32 next = spellmgr.GetNextSpellInChain(spellid))
- learnSpellHighRank(next);
+ DoPetLearnSpell worker(*this);
+ spellmgr.doForHighRanks(spellid,worker);
}
void Pet::SynchronizeLevelWithOwner()