Skip to content

Commit

Permalink
EAI: Fix EVENT_T_DEATH not working with two layers deep PCs and fix n…
Browse files Browse the repository at this point in the history
…pcs not being checked against cond
  • Loading branch information
killerwife committed Sep 9, 2023
1 parent 966698d commit 8814aa9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/game/AI/EventAI/CreatureEventAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,12 @@ bool CreatureEventAI::CheckEvent(CreatureEventAIHolder& holder, Unit* actionInvo
if (!actionInvoker)
return false;

if (Player* player = actionInvoker->GetBeneficiaryPlayer())
if (!sObjectMgr.IsConditionSatisfied(event.death.conditionId, player, player->GetMap(), m_creature, CONDITION_FROM_EVENTAI))
return false;
Unit const* controller = actionInvoker->GetControllingPlayer();
if (!controller) // only allow going forward if we can evaluate condition
controller = actionInvoker;

if (!sObjectMgr.IsConditionSatisfied(event.death.conditionId, controller, controller->GetMap(), m_creature, CONDITION_FROM_EVENTAI))
return false;
}
break;
case EVENT_T_EVADE:
Expand Down

0 comments on commit 8814aa9

Please sign in to comment.