diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index 31a9d1ff358..cf0c9791ed0 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -1297,9 +1297,16 @@ void CCharEntity::OnAbility(CAbilityState& state, action_t& action) return; } + uint8 findFlags = 0; + + if ((PAbility->getValidTarget() & TARGET_PLAYER_DEAD) == TARGET_PLAYER_DEAD) + { + findFlags |= FINDFLAGS_DEAD; + } + auto* PTarget = static_cast(state.GetTarget()); PAI->TargetFind->reset(); - PAI->TargetFind->findSingleTarget(PTarget); + PAI->TargetFind->findSingleTarget(PTarget, findFlags); // Check if target is untargetable if (PAI->TargetFind->m_targets.size() == 0) @@ -1526,7 +1533,7 @@ void CCharEntity::OnAbility(CAbilityState& state, action_t& action) float distance = PAbility->getRange(); - PAI->TargetFind->findWithinArea(this, AOE_RADIUS::ATTACKER, distance); + PAI->TargetFind->findWithinArea(this, AOE_RADIUS::ATTACKER, distance, findFlags); uint16 prevMsg = 0; for (auto&& PTargetFound : PAI->TargetFind->m_targets) diff --git a/src/map/entities/petentity.cpp b/src/map/entities/petentity.cpp index b5b25517c62..5b13f18905d 100644 --- a/src/map/entities/petentity.cpp +++ b/src/map/entities/petentity.cpp @@ -407,6 +407,11 @@ void CPetEntity::OnPetSkillFinished(CPetSkillState& state, action_t& action) findFlags |= FINDFLAGS_IGNORE_BATTLEID; } + if ((PSkill->getValidTargets() & TARGET_PLAYER_DEAD) == TARGET_PLAYER_DEAD) + { + findFlags |= FINDFLAGS_DEAD; + } + action.id = id; action.actiontype = (ACTIONTYPE)PSkill->getSkillFinishCategory(); action.actionid = PSkill->getID();