mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Pet): Fix player pets attack (#22601)
Co-authored-by: PkllonG <[email protected]>
This commit is contained in:
co-authored by
PkllonG
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