mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -116,20 +116,20 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
|
||||
//TODO: Send proper error message to client
|
||||
return;
|
||||
}
|
||||
|
||||
// only place where pet can be player
|
||||
pet->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
const uint64& selguid = _player->GetSelection();
|
||||
Unit *TargetUnit = ObjectAccessor::GetUnit(*_player, selguid);
|
||||
Unit *TargetUnit = ObjectAccessor::GetUnit(*_player, guid2);
|
||||
if(!TargetUnit)
|
||||
return;
|
||||
|
||||
// not let attack friendly units.
|
||||
if(GetPlayer()->IsFriendlyTo(TargetUnit))
|
||||
if(!pet->canAttack(TargetUnit))
|
||||
return;
|
||||
|
||||
// Not let attack through obstructions
|
||||
//if(!pet->IsWithinLOSInMap(TargetUnit))
|
||||
// return;
|
||||
|
||||
pet->clearUnitState(UNIT_STAT_FOLLOW);
|
||||
// This is true if pet has no target or has target but targets differs.
|
||||
if(pet->getVictim() != TargetUnit)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user