*Backup your DB!

[8098] Support uint32 spell ids in code. Author: VladimirMangos

    * Propertly work with uint32 spell ids in player action bar
    * Fix in same time bug with not save equipment set button with id==0
    * Merge misc field in character_action and playercreateinfo_action to action field as 3 byte
    * Propertly load uint32 spell ids from character_spell
    * Fixed types for some pet/creature related structure for spell id storing.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-07-01 18:07:20 -05:00
1 parent 8122a15f46
commit e1d93bd00f
16 files changed
+635 -571

No files matched your search

+12 -12
View File
@@ -412,8 +412,8 @@ void Pet::SavePetToDB(PetSaveMode mode)
// 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) << " ";
ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << " "
<< uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << " ";
};
ss << "', "
@@ -1064,7 +1064,7 @@ void Pet::_LoadSpells()
{
Field *fields = result->Fetch();
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt16()), PETSPELL_UNCHANGED);
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt8()), PETSPELL_UNCHANGED);
}
while( result->NextRow() );
@@ -1329,8 +1329,8 @@ bool Pet::learnSpell(uint32 spell_id)
if(!m_loading)
{
WorldPacket data(SMSG_PET_LEARNED_SPELL, 2);
data << uint16(spell_id);
WorldPacket data(SMSG_PET_LEARNED_SPELL, 4);
data << uint32(spell_id);
m_owner->GetSession()->SendPacket(&data);
m_owner->PetSpellInitialize();
}
@@ -1382,8 +1382,8 @@ bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
{
if(!m_loading)
{
WorldPacket data(SMSG_PET_REMOVED_SPELL, 2);
data << uint16(spell_id);
WorldPacket data(SMSG_PET_REMOVED_SPELL, 4);
data << uint32(spell_id);
m_owner->GetSession()->SendPacket(&data);
}
return true;
@@ -1447,12 +1447,12 @@ void Pet::CleanupActionBar()
{
for(uint8 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
if(UnitActionBarEntry const* ab = m_charmInfo->GetActionBarEntry(i))
if(ab->SpellOrAction && ab->IsActionBarForSpell())
if(ab->GetAction() && ab->IsActionBarForSpell())
{
if(!HasSpell(ab->SpellOrAction))
if(!HasSpell(ab->GetAction()))
m_charmInfo->SetActionBar(i, 0, ACT_PASSIVE);
else if(ab->Type == ACT_ENABLED)
ToggleAutocast(ab->SpellOrAction, true);
else if(ab->GetType() == ACT_ENABLED)
ToggleAutocast(ab->GetAction(), true);
}
}
@@ -1832,7 +1832,7 @@ void Pet::CastPetAuras(bool current)
void Pet::CastPetAura(PetAura const* aura)
{
uint16 auraId = aura->GetAura(GetEntry());
uint32 auraId = aura->GetAura(GetEntry());
if(!auraId)
return;