From 6bfa5f52442a2ce3c0c250ed36b725a95609e4db Mon Sep 17 00:00:00 2001 From: insuna Date: Mon, 7 Oct 2024 08:40:24 +0200 Subject: [PATCH] StaticFlags: Implement NO_MELEE_APPROACH (#539) * StaticFlags: Implement NO_MELEE_APPROACH * StaticFlags: Fix meaning of No Melee (Approach) * StaticFlags: Only use SetMeleeEnabled once --- src/game/AI/BaseAI/CreatureAI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/AI/BaseAI/CreatureAI.cpp b/src/game/AI/BaseAI/CreatureAI.cpp index cef26cfe051..77d7473fd77 100644 --- a/src/game/AI/BaseAI/CreatureAI.cpp +++ b/src/game/AI/BaseAI/CreatureAI.cpp @@ -34,7 +34,8 @@ CreatureAI::CreatureAI(Creature* creature, uint32 combatActions) : m_deathPrevented(false), m_followAngle(0.f), m_followDist(0.f) { m_dismountOnAggro = !(m_creature->GetCreatureInfo()->CreatureTypeFlags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT); - SetMeleeEnabled(!m_creature->GetSettings().HasFlag(CreatureStaticFlags::NO_MELEE_FLEE)); + SetMeleeEnabled(!(m_creature->GetSettings().HasFlag(CreatureStaticFlags::NO_MELEE_FLEE) + || m_creature->GetSettings().HasFlag(CreatureStaticFlags4::NO_MELEE_APPROACH))); if (m_creature->GetSettings().HasFlag(CreatureStaticFlags::SESSILE)) SetAIImmobilizedState(true);