mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/SAI: Fixed a mistake in SMART_TARGET_INVOKER_PARTY which made it add the same player to the targetlist twice if there was a group.
This commit is contained in:
@@ -2123,12 +2123,20 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
case SMART_TARGET_INVOKER_PARTY:
|
||||
if (trigger)
|
||||
{
|
||||
l->push_back(trigger);
|
||||
if (Player* player = trigger->ToPlayer())
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->getSource())
|
||||
l->push_back(member);
|
||||
}
|
||||
// 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
|
||||
// same player to the list twice. We don't want that to happen.
|
||||
else
|
||||
l->push_back(trigger);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SMART_TARGET_CREATURE_RANGE:
|
||||
|
||||
Reference in New Issue
Block a user