mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix(Core/Creature): Use home position for leash distance check for creatures with no movement. (#22245)
This commit is contained in:
@@ -2690,9 +2690,11 @@ bool Creature::CanCreatureAttack(Unit const* victim, bool skipDistCheck) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
GetMotionMaster()->GetMotionSlot(MOTION_SLOT_IDLE)->GetResetPosition(x, y, z);
|
x = y = z = 0.0f;
|
||||||
|
if (GetMotionMaster()->GetMotionSlot(MOTION_SLOT_IDLE)->GetResetPosition(x, y, z))
|
||||||
return IsInDist2d(x, y, dist);
|
return IsInDist2d(x, y, dist);
|
||||||
|
else
|
||||||
|
return IsInDist2d(&m_homePosition, dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureAddon const* Creature::GetCreatureAddon() const
|
CreatureAddon const* Creature::GetCreatureAddon() const
|
||||||
|
|||||||
Reference in New Issue
Block a user