mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-06 17:08:23 +01:00
Core/Creatures: moved AIReaction to AtEngage to ensure that ai reactions wont be sent when entering combat with a creature that might not even engage us
This commit is contained in:
@@ -3311,14 +3311,6 @@ bool Creature::IsEngaged() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Creature::AtEnterCombat()
|
||||
{
|
||||
Unit::AtEnterCombat();
|
||||
|
||||
if (GetAI() && !IsControlledByPlayer())
|
||||
SendAIReaction(AI_REACTION_HOSTILE);
|
||||
}
|
||||
|
||||
void Creature::AtEngage(Unit* target)
|
||||
{
|
||||
Unit::AtEngage(target);
|
||||
@@ -3336,6 +3328,9 @@ void Creature::AtEngage(Unit* target)
|
||||
ai->JustEngagedWith(target);
|
||||
if (CreatureGroup* formation = GetFormation())
|
||||
formation->MemberEngagingTarget(this, target);
|
||||
|
||||
if (GetAI() && !IsControlledByPlayer())
|
||||
SendAIReaction(AI_REACTION_HOSTILE);
|
||||
}
|
||||
|
||||
void Creature::AtDisengage()
|
||||
|
||||
@@ -363,7 +363,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
void MakeInterruptable(bool apply);
|
||||
|
||||
bool IsEngaged() const override;
|
||||
void AtEnterCombat() override;
|
||||
void AtEngage(Unit* target) override;
|
||||
void AtDisengage() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user