[12220] Improve Initialisation of COMMAND_ATTACK field

This moves the set command of COMMAND_ATTACK out of CharmInfo::InitPetAction bar, so that this function can be used more genericly for other purposes

Signed-off-by: Schmoozerd <cmangos>
This commit is contained in:
kid10 2012-09-13 23:06:41 +02:00 committed by Antz
parent e635569d08
commit 164c2e137b
2 changed files with 3 additions and 2 deletions

View file

@ -10075,7 +10075,6 @@ void CharmInfo::InitPetActionBar()
void CharmInfo::InitEmptyActionBar()
{
SetActionBar(ACTION_BAR_INDEX_START, COMMAND_ATTACK, ACT_COMMAND);
for (uint32 x = ACTION_BAR_INDEX_START + 1; x < ACTION_BAR_INDEX_END; ++x)
SetActionBar(x, 0, ACT_PASSIVE);
}
@ -10087,6 +10086,8 @@ void CharmInfo::InitPossessCreateSpells()
if (m_unit->GetTypeId() == TYPEID_PLAYER) // possessed players don't have spells, keep the action bar empty
return;
SetActionBar(ACTION_BAR_INDEX_START, COMMAND_ATTACK, ACT_COMMAND);
for (uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x)
{
if (IsPassiveSpell(((Creature*)m_unit)->m_spells[x]))