Core/SmartScripts: Add SMART_TARGET_LOOT_RECIPIENTS. Does what it says on the tin.

Use this new target type to fix The Rider of Blood, The Rider of Frost, The Rider of the Unholy. Closes #17817.
This commit is contained in:
treeston
2016-08-19 14:25:23 +02:00
parent 3f9cf3fdb6
commit e2c915fb43
4 changed files with 22 additions and 1 deletions
@@ -2751,6 +2751,23 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
l->push_back(target);
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_POSITION:
case SMART_TARGET_NONE:
default: