mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-14 04:02:53 -04:00
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.
(cherry picked from commit e2c915fb43)
This commit is contained in:
@@ -2783,6 +2783,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:
|
||||
|
||||
Reference in New Issue
Block a user