aboutsummaryrefslogtreecommitdiff
path: root/src/game/Pet.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-02 17:47:54 -0500
committermegamage <none@none>2009-06-02 17:47:54 -0500
commit72cb88c19f15a97cda090ea0c138ebf9e5acadc1 (patch)
treee0eea969075b062e084c6775736fd12016cac1bb /src/game/Pet.cpp
parent81af1151940370a5be1be00c52fd9330747f31f2 (diff)
* Revert partly "[7903] Load and save for pets only talents." Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src/game/Pet.cpp')
-rw-r--r--src/game/Pet.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index fd71d2088b3..3a72120cb79 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -1053,17 +1053,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
- uint32 spell_id = fields[0].GetUInt32();
-
- // load only pet talents, other spell types auto-learned
- if(GetTalentSpellCost(spell_id)==0)
- {
- CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'",spell_id);
- sLog.outError("Table `pet_spell` have non-talent spell %u , spell removed from table for all pets.",spell_id);
- continue;
- }
-
- addSpell(spell_id, ActiveStates(fields[1].GetUInt16()), PETSPELL_UNCHANGED,PETSPELL_TALENT);
+ addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt16()), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@@ -1077,8 +1067,8 @@ void Pet::_SaveSpells()
{
++next;
- // save only talent spells for pets, other spells auto-applied
- if (itr->second.type != PETSPELL_TALENT)
+ // prevent saving family passives to DB
+ if (itr->second.type == PETSPELL_FAMILY)
continue;
switch(itr->second.state)
@@ -1255,9 +1245,6 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
// talent: unlearn all other talent ranks (high and low)
if(TalentSpellPos const* talentPos = GetTalentSpellPos(spell_id))
{
- // propertly mark spell for allow save
- newspell.type = PETSPELL_TALENT;
-
if(TalentEntry const *talentInfo = sTalentStore.LookupEntry( talentPos->talent_id ))
{
for(int i=0; i < MAX_TALENT_RANK; ++i)