Skip to content

Commit

Permalink
Fix crash when pets with Eluna AI enter combat but the controller doe…
Browse files Browse the repository at this point in the history
…s not
  • Loading branch information
Niam5 committed Dec 31, 2023
1 parent d71fee3 commit df8b5d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8531,6 +8531,13 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
if (PvP || creatureNotInCombat)
enemy->GetCombatManager().TriggerCombatTimer(controller);
}
#ifdef BUILD_ELUNA
else if (elunaEvents)
{
controller->SetInCombatWith(enemy); // player needs to enter combat with summoned Eluna pet
enemy->AddThreat(controller);
}
#endif
else
{
MANGOS_ASSERT(controller->AI()); // a player without UNIT_FLAG_PLAYER_CONTROLLED should always have AI
Expand Down

0 comments on commit df8b5d6

Please sign in to comment.