mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
feat(Core/SAI): Add pet variable to SMART_TARGET_INVOKER_PARTY (#20804)
* feat(Core/SAI): Add pet variable to SMART_TARGET_INVOKER_PARTY * closes https://github.com/azerothcore/azerothcore-wotlk/issues/15755 * mb
This commit is contained in:
@@ -3511,8 +3511,15 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
{
|
||||
if (member->IsInMap(player))
|
||||
targets.push_back(member);
|
||||
|
||||
if (e.target.invokerParty.includePets)
|
||||
if (Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*member, member->GetPetGUID()))
|
||||
if (pet->IsPet() && pet->IsInMap(player))
|
||||
targets.push_back(pet);
|
||||
}
|
||||
}
|
||||
// We still add the player to the list if there is no group. If we do
|
||||
// this even if there is a group (thus the else-check), it will add the
|
||||
|
||||
Reference in New Issue
Block a user