More work on pet spells, typo fix

This commit is contained in:
tomrus88 2008-11-05 21:47:56 +03:00
parent 7adf2001f3
commit d48844a699
9 changed files with 146 additions and 123 deletions

View file

@ -155,7 +155,6 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
}
break;
case ACT_DISABLED: //0x8100 spell (disabled), ignore
case ACT_CAST: //0x0100
case ACT_ENABLED: //0xc100 spell
{
Unit* unit_target;
@ -349,7 +348,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
sLog.outDetail( "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X\n", _player->GetName(), position, spell_id, act_state);
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
if(!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_CAST) && spell_id && !pet->HasSpell(spell_id)))
if(!((act_state == ACT_ENABLED || act_state == ACT_DISABLED) && spell_id && !pet->HasSpell(spell_id)))
{
//sign for autocast
if(act_state == ACT_ENABLED && spell_id)
@ -519,7 +518,8 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
{
uint32 spell_id = itr->first; // Pet::removeSpell can invalidate iterator at erase NEW spell
++itr;
pet->removeSpell(spell_id);
//pet->removeSpell(spell_id);
pet->unlearnSpell(spell_id);
}
for(uint8 i = 0; i < 10; i++)