fix(Core/Units): charmed creatures do not need to check hostility to attacked creature (#7043)

Properly remove channelled charm auras on demand.
- Closes #5447
This commit is contained in:
UltraNix
2021-07-23 09:31:04 +02:00
committed by GitHub
parent da392517cb
commit e450fd6f68
2 changed files with 17 additions and 6 deletions

View File

@@ -558,10 +558,11 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
if (!owner->IsValidAttackTarget(TargetUnit))
return;
// pussywizard:
if (Creature* creaturePet = pet->ToCreature())
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit))
return;
// pussywizard (excluded charmed)
if (!pet->IsCharmed())
if (Creature* creaturePet = pet->ToCreature())
if (!creaturePet->_CanDetectFeignDeathOf(TargetUnit) || !creaturePet->CanCreatureAttack(TargetUnit))
return;
// Not let attack through obstructions
bool checkLos = !DisableMgr::IsPathfindingEnabled(pet->GetMap()) ||