feat(Core/SmartScripts): SMART_TARGET_LOOT_RECIPIENTS (#9967)

This commit is contained in:
IntelligentQuantum
2022-01-03 04:24:27 +03:30
committed by GitHub
parent 7d25a0fb68
commit 8a5b96349b
3 changed files with 25 additions and 1 deletions

View File

@@ -3835,6 +3835,29 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
}
break;
}
case SMART_TARGET_LOOT_RECIPIENTS:
{
if (me)
{
if (Group* lootGroup = me->GetLootRecipientGroup())
{
for (GroupReference* it = lootGroup->GetFirstMember(); it != nullptr; it = it->next())
{
if (Player* recipient = it->GetSource())
{
l->push_back(recipient);
}
}
}
else
{
if (Player* recipient = me->GetLootRecipient())
{
l->push_back(recipient);
}
}
}
}
case SMART_TARGET_NONE:
case SMART_TARGET_POSITION:
default: