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 14, 2023
1 parent d994fb6 commit 16b1f40
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 @@ -8532,6 +8532,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 16b1f40

Please sign in to comment.