mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Units: Prevent backward melee attacks (#28895)
This commit is contained in:
@@ -68,6 +68,10 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
if (!me->IsWithinMeleeRange(victim))
|
||||
return;
|
||||
|
||||
// Check that the victim is in front of the unit
|
||||
if (!me->HasInArc(2 * float(M_PI) / 3, victim))
|
||||
return;
|
||||
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user