[7468] Convert pet cast check code to use SpellCastResult and finaly fix SPELL_CAST_OK value (255 custom value now)

This commit is contained in:
VladimirMangos 2009-03-16 15:39:10 +03:00
parent 0e987bf59e
commit 5d6cb5fe80
7 changed files with 20 additions and 20 deletions

View file

@ -189,7 +189,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
Spell *spell = new Spell(pet, spellInfo, false);
int16 result = spell->PetCanCast(unit_target);
SpellCastResult result = spell->CheckPetCast(unit_target);
//auto turn to target unless possessed
if(result == SPELL_FAILED_UNIT_NOT_INFRONT && !pet->HasAuraType(SPELL_AURA_MOD_POSSESS))
@ -200,10 +200,10 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
if(Unit* powner = pet->GetCharmerOrOwner())
if(powner->GetTypeId() == TYPEID_PLAYER)
pet->SendUpdateToPlayer((Player*)powner);
result = -1;
result = SPELL_CAST_OK;
}
if(result == -1)
if(result == SPELL_CAST_OK)
{
((Creature*)pet)->AddCreatureSpellCooldown(spellid);
if (((Creature*)pet)->isPet())
@ -610,8 +610,8 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
spell->m_cast_count = cast_count; // probably pending spell cast
spell->m_targets = targets;
int16 result = spell->PetCanCast(NULL);
if(result == -1)
SpellCastResult result = spell->CheckPetCast(NULL);
if(result == SPELL_CAST_OK)
{
pet->AddCreatureSpellCooldown(spellid);
if(pet->isPet())