[7932] Store in DB only spell part of pet action bar, set other to default state (reaction saved).

This commit is contained in:
VladimirMangos 2009-06-01 04:39:32 +04:00
parent c386bef32e
commit 7d6bf1fdbf
7 changed files with 44 additions and 27 deletions

View file

@ -239,14 +239,9 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
CharacterDatabase.CommitTransaction();
}
// load action bar, if data broken will fill later by default spells.
if (!is_temporary_summoned)
{
if(!m_charmInfo->LoadActionBar(fields[13].GetCppString()))
{
delete result;
return false;
}
}
m_charmInfo->LoadPetActionBar(fields[13].GetCppString());
// since last save (in seconds)
uint32 timediff = (time(NULL) - fields[14].GetUInt32());
@ -411,7 +406,8 @@ void Pet::SavePetToDB(PetSaveMode mode)
<< curmana << ", "
<< GetPower(POWER_HAPPINESS) << ", '";
for(uint32 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
// save only spell slots from action bar
for(uint32 i = ACTION_BAR_INDEX_PET_SPELL_START; i < ACTION_BAR_INDEX_PET_SPELL_END; ++i)
{
ss << uint32(m_charmInfo->GetActionBarEntry(i)->Type) << " "
<< uint32(m_charmInfo->GetActionBarEntry(i)->SpellOrAction) << " ";