[7716] Fixed some typos and possible crashes.

This commit is contained in:
AlexDereka 2009-04-26 18:49:00 +04:00
parent c2e6dd20dd
commit c9d51a6dc7
25 changed files with 281 additions and 263 deletions

View file

@ -194,10 +194,19 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
//auto turn to target unless possessed
if(result == SPELL_FAILED_UNIT_NOT_INFRONT && !pet->HasAuraType(SPELL_AURA_MOD_POSSESS))
{
pet->SetInFront(unit_target);
if( unit_target->GetTypeId() == TYPEID_PLAYER )
pet->SendUpdateToPlayer( (Player*)unit_target );
if(Unit* powner = pet->GetCharmerOrOwner())
if(unit_target)
{
pet->SetInFront(unit_target);
if (unit_target->GetTypeId() == TYPEID_PLAYER)
pet->SendUpdateToPlayer( (Player*)unit_target );
}
else if(Unit *unit_target2 = spell->m_targets.getUnitTarget())
{
pet->SetInFront(unit_target2);
if (unit_target2->GetTypeId() == TYPEID_PLAYER)
pet->SendUpdateToPlayer( (Player*)unit_target2 );
}
if (Unit* powner = pet->GetCharmerOrOwner())
if(powner->GetTypeId() == TYPEID_PLAYER)
pet->SendUpdateToPlayer((Player*)powner);
result = SPELL_CAST_OK;