mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
fix(Core/Pet): Fix player pets attack (#22601)
Co-authored-by: PkllonG <PkllonG@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cd87350a17
commit
548447ffb0
@@ -2683,15 +2683,13 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool skipDistCheck) const
|
||||
if (skipDistCheck)
|
||||
return true;
|
||||
|
||||
float dist = sWorld->getFloatConfig(CONFIG_CREATURE_LEASH_RADIUS);
|
||||
|
||||
if (Unit* unit = GetCharmerOrOwner())
|
||||
{
|
||||
float visibilityDist = std::min<float>(GetMap()->GetVisibilityRange() + GetObjectSize() * 2, 150.0f);
|
||||
if (!victim->IsWithinDist(unit, visibilityDist))
|
||||
return false;
|
||||
float visibilityDist = std::min<float>(GetMap()->GetVisibilityRange() + GetObjectSize() * 2, DEFAULT_VISIBILITY_DISTANCE);
|
||||
return victim->IsWithinDist(unit, visibilityDist);
|
||||
}
|
||||
|
||||
float dist = sWorld->getFloatConfig(CONFIG_CREATURE_LEASH_RADIUS);
|
||||
if (!dist)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user