Core/Units: Prevent backward melee attacks (#28895)

This commit is contained in:
Meji
2023-04-07 20:54:03 +02:00
committed by GitHub
parent 422d521667
commit 7d5d3cf655

View File

@@ -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())
{