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:
Discover-
2012-06-04 17:20:40 +02:00
parent 0d09774984
commit 19dbfbeb62

View File

@@ -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: