mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
[Core / Fix] Fixed an issue if charmed creatures was created by spell they wouldn't disappear if owner was too far away from it.
Lets take quest Taming the beast for example, Once beast was tamed and player was too far away from the creature it would still appear as a pet and cause issues.
This commit is contained in:
@@ -577,6 +577,12 @@ void Creature::Update(uint32 diff)
|
||||
SelectVictim();
|
||||
}
|
||||
|
||||
Unit* owner = GetCharmerOrOwner();
|
||||
if (IsCharmed() && !IsWithinDistInMap(owner, GetMap()->GetVisibilityRange()))
|
||||
{
|
||||
RemoveCharmAuras();
|
||||
}
|
||||
|
||||
if (!IsInEvadeMode() && IsAIEnabled)
|
||||
{
|
||||
// do not allow the AI to be changed during update
|
||||
|
||||
Reference in New Issue
Block a user