本文整理汇总了C++中SubGroup::GetGroupMembersEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ SubGroup::GetGroupMembersEnd方法的具体用法?C++ SubGroup::GetGroupMembersEnd怎么用?C++ SubGroup::GetGroupMembersEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubGroup
的用法示例。
在下文中一共展示了SubGroup::GetGroupMembersEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpellTargetSameGroupSameClass
/// Spell Target Handling for type 61: targets with the same group/raid and the same class
void Spell::SpellTargetSameGroupSameClass(uint32 i, uint32 j)
{
TargetsList* tmpMap=&m_targetUnits[i];
if(!m_caster->IsInWorld())
return;
Player * Target = m_caster->GetMapMgr()->GetPlayer((uint32)m_targets.m_unitTarget);
if(!Target)
return;
SubGroup * subgroup = Target->GetGroup() ?
Target->GetGroup()->GetSubGroup(Target->GetSubGroup()) : 0;
if(subgroup)
{
Target->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); ++itr)
{
if(!(*itr)->m_loggedInPlayer || Target->getClass() != (*itr)->m_loggedInPlayer->getClass())
continue;
SafeAddTarget(tmpMap,(*itr)->m_loggedInPlayer->GetGUID());
}
Target->GetGroup()->Unlock();
}
}
示例2: SpellTargetPartyMember
// Spell Target Handling for type 37: all Members of the targets party
void Spell::SpellTargetPartyMember(uint32 i, uint32 j)
{
if(!m_caster->IsInWorld())
return;
// if no group target self
Player* Target = m_caster->GetMapMgr()->GetPlayer((uint32)m_targets.m_unitTarget);
if(!Target)
return;
SubGroup * subgroup = Target->GetGroup() ?
Target->GetGroup()->GetSubGroup(Target->GetSubGroup()) : 0;
if(subgroup)
{
Target->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); itr++)
{
if((*itr)->m_loggedInPlayer)
_AddTargetForced( (*itr)->m_loggedInPlayer->GetGUID(), i );
}
Target->GetGroup()->Unlock();
}
else
_AddTargetForced(Target->GetGUID(), i);
}
示例3: SpellTargetPartyMember
/// Spell Target Handling for type 37: all Members of the targets party
void Spell::SpellTargetPartyMember(uint32 i, uint32 j)
{
if(!m_caster->IsInWorld())
return;
TargetsList* tmpMap=&m_targetUnits[i];
// if no group target self
Player * Target = m_caster->GetMapMgr()->GetPlayer((uint32)m_targets.m_unitTarget);
if(!Target)
return;
SubGroup * subgroup = Target->GetGroup() ?
Target->GetGroup()->GetSubGroup(Target->GetSubGroup()) : 0;
float rsqr = GetRadius( i );
if( rsqr == 0 )
rsqr = 40*40;//kinda like a bug. 0 range to target a party member ? Highly impossible
else rsqr *= rsqr;
if(subgroup)
{
Target->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); ++itr)
//if you are picky you could also check if on same map. Let's face it you won't similar positions on different maps
if((*itr)->m_loggedInPlayer && IsInrange(Target,(*itr)->m_loggedInPlayer, rsqr) )
SafeAddTarget(tmpMap,(*itr)->m_loggedInPlayer->GetGUID());
Target->GetGroup()->Unlock();
}
else
{
SafeAddTarget(tmpMap,Target->GetGUID());
}
}
示例4: SpellTargetAllRaid
// Spell Target Handling for type 56: Target all raid members. (WotLK)
void Spell::SpellTargetAllRaid( uint32 i, uint32 j )
{
if( !m_caster->IsInWorld() || !m_caster->IsUnit() )
return;
TargetsList* tmpMap = &m_targetUnits[i];
SafeAddTarget( tmpMap, m_caster->GetGUID() );
Group * group = static_cast< Unit* >( m_caster )->GetGroup();
if( group == NULL )
return;
uint32 count = group->GetSubGroupCount();
// Loop through each raid group.
group->Lock();
for( uint8 k = 0; k < count; k++ )
{
SubGroup * subgroup = group->GetSubGroup( k );
if( subgroup )
{
for( GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); ++itr )
{
if( (*itr)->m_loggedInPlayer && (*itr)->m_loggedInPlayer != m_caster)
SafeAddTarget( tmpMap,(*itr)->m_loggedInPlayer->GetGUID() );
}
}
}
group->Unlock();
}
示例5: SendLootUpdates
void Group::SendLootUpdates( Object *o ){
// Build the actual update.
ByteBuffer buf( 500 );
uint32 Flags = o->GetUInt32Value( UNIT_DYNAMIC_FLAGS );
Flags |= U_DYN_FLAG_LOOTABLE;
Flags |= U_DYN_FLAG_TAPPED_BY_PLAYER;
o->BuildFieldUpdatePacket( &buf, UNIT_DYNAMIC_FLAGS, Flags );
Lock();
switch( m_LootMethod ){
case PARTY_LOOT_RR:
case PARTY_LOOT_FFA:
case PARTY_LOOT_GROUP:
case PARTY_LOOT_NBG:{
SubGroup *sGrp = NULL;
GroupMembersSet::iterator itr2;
for( uint32 Index = 0; Index < GetSubGroupCount(); ++Index ){
sGrp = GetSubGroup( Index );
itr2 = sGrp->GetGroupMembersBegin();
for( ; itr2 != sGrp->GetGroupMembersEnd(); ++itr2 ){
PlayerInfo *p = *itr2;
if( p->m_loggedInPlayer != NULL && p->m_loggedInPlayer->IsVisible( o->GetGUID() ) ) // Save updates for non-existent creatures
p->m_loggedInPlayer->PushUpdateData( &buf, 1 );
}
}
break;}
case PARTY_LOOT_MASTER:{
Player * pLooter = GetLooter() ? GetLooter()->m_loggedInPlayer : NULL;
if( pLooter == NULL )
pLooter = GetLeader()->m_loggedInPlayer;
if( pLooter->IsVisible( o->GetGUID() ) ){
Unit *victim = static_cast< Unit* >( o );
victim->Tag( pLooter->GetGUID() );
pLooter->PushUpdateData( &buf, 1 );
}
break;}
}
Unlock();
}
示例6: HandleLootOpcode
void WorldSession::HandleLootOpcode( WorldPacket & recv_data )
{
if(!_player->IsInWorld())
return;
uint64 guid;
recv_data >> guid;
if(_player->isCasting())
_player->InterruptSpell();
if(_player->InGroup() && !_player->m_bgInBattleground)
{
Group * party = _player->GetGroup();
if(party)
{
if(party->GetMethod() == PARTY_LOOT_MASTER)
{
WorldPacket data(SMSG_LOOT_MASTER_LIST, 330); // wont be any larger
data << (uint8)party->MemberCount();
uint32 real_count = 0;
SubGroup *s;
GroupMembersSet::iterator itr;
for(uint32 i = 0; i < party->GetSubGroupCount(); ++i)
{
s = party->GetSubGroup(i);
for(itr = s->GetGroupMembersBegin(); itr != s->GetGroupMembersEnd(); ++itr)
{
if(_player->GetZoneId() == (*itr)->GetZoneId())
{
data << (*itr)->GetGUID();
++real_count;
}
}
}
*(uint8*)&data.contents()[0] = real_count;
party->SendPacketToAll(&data);
}
/* //this commented code is not used because it was never tested and finished !
else if(party->GetMethod() == PARTY_LOOT_RR)
{
Creature *target=GetPlayer()->GetMapMgr()->GetCreature(guid); //maybe we should extend this to other object types too
if(target)
{
if(target->TaggerGuid==GetPlayer()->GetGUID())
GetPlayer()->SendLoot(guid,1);
else return;
}
}*/
}
}
GetPlayer()->SendLoot(guid,1);
}
示例7: SendPacketToAllInRange
void Group::SendPacketToAllInRange(Player* plr, WorldPacket* packet)
{
Lock();
for(uint8 i = 0; i < GetSubGroupCount(); ++i)
{
SubGroup* sg = GetSubGroup(i);
for(GroupMembersSet::iterator itr = sg->GetGroupMembersBegin(); itr != sg->GetGroupMembersEnd(); ++itr)
{
if((*itr)->m_loggedInPlayer && (*itr)->m_loggedInPlayer->GetDistance2dSq(plr) < 80.0f)
(*itr)->m_loggedInPlayer->GetSession()->SendPacket(packet);
}
}
Unlock();
}
示例8: OnKillPlayer
void GenericBattleground::OnKillPlayer(Player * pPlayer, Player * pVictim)
{
if( pPlayer == NULL || pVictim == NULL || pPlayer != pVictim )
return;
Group * pGroup = pPlayer->GetGroup();
if( pGroup == NULL )
{
pPlayer->BroadcastMessage("You've been awarded 10 gold for slaying %s", pVictim->GetName());
pPlayer->ModUnsigned32Value(PLAYER_FIELD_COINAGE, 100000);
}
else
{
std::vector<Player*> GroupMembers;
std::set<Player*> PotentialHealers;
pPlayer->GetGroup()->Lock();
for(uint8 i = 0; i < pPlayer->GetGroup()->GetSubGroupCount(); i++)
{
SubGroup * pSubGroup = pPlayer->GetGroup()->GetSubGroup(i);
if(!pSubGroup) continue;
GroupMembersSet::iterator itr = pSubGroup->GetGroupMembersBegin();
for(; itr != pSubGroup->GetGroupMembersEnd(); itr++)
{
PlayerInfo * pi = *itr;
if(!pi) continue;
Player * tPlr = pi->m_loggedInPlayer;
if(!tPlr)
continue;
// Ineligible due to distance.
if(tPlr->GetDistance2dSq(pPlayer) > 80.0f && tPlr != pPlayer)
continue;
GroupMembers.push_back(pi->m_loggedInPlayer);
}
}
// Pick a number, any number!
if(GroupMembers.size() > 0)
{
uint32 reward = RandomUInt(GroupMembers.size() - 1);
GroupMembers[reward]->ModUnsigned32Value(PLAYER_FIELD_COINAGE, 100000);
GroupMembers[reward]->BroadcastMessage("You've been awarded 10 gold for slaying %s.", pVictim->GetName());
}
pPlayer->GetGroup()->Unlock();
}
}
示例9: SpellTargetAllPartyMembersRangeNR
/// Spell Target Handling for type 18: All Party Members around the Caster in given range NOT RAID
void Spell::SpellTargetAllPartyMembersRangeNR(uint32 i, uint32 j)
{
TargetsList* tmpMap = &m_targetUnits[i];
Player* p = p_caster;
if( p == NULL )
{
if( static_cast< Creature* >( u_caster)->IsTotem() )
p = static_cast< Player* >( static_cast< Creature* >( u_caster )->GetTotemOwner() );
else if( u_caster->IsPet() && static_cast< Pet* >( u_caster )->GetPetOwner() )
p = static_cast< Pet* >( u_caster )->GetPetOwner();
else if( u_caster->GetUInt64Value( UNIT_FIELD_CREATEDBY ) )
{
Unit *t = u_caster->GetMapMgr()->GetUnit( u_caster->GetUInt64Value( UNIT_FIELD_CREATEDBY ) );
if ( t && t->IsPlayer() )
p = static_cast< Player* >( t );
}
}
if( p == NULL )
return;
float r = GetRadius(i);
r *= r;
if( IsInrange( m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), p, r ) )
SafeAddTarget( tmpMap, p->GetGUID() );
SubGroup* subgroup = p->GetGroup() ? p->GetGroup()->GetSubGroup( p->GetSubGroup() ) : 0;
if( subgroup != NULL )
{
p->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); ++itr)
{
if(!(*itr)->m_loggedInPlayer || m_caster == (*itr)->m_loggedInPlayer)
continue;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),(*itr)->m_loggedInPlayer,r))
SafeAddTarget(tmpMap,(*itr)->m_loggedInPlayer->GetGUID());
}
p->GetGroup()->Unlock();
}
}
示例10: UpdateAchievementCriteriaForInrange
void Group::UpdateAchievementCriteriaForInrange( Object *o, AchievementCriteriaTypes type, int32 miscvalue1, int32 miscvalue2, uint32 time ){
Lock();
SubGroup *sGrp = NULL;
GroupMembersSet::iterator itr2;
for( uint32 Index = 0; Index < GetSubGroupCount(); ++Index ){
sGrp = GetSubGroup( Index );
itr2 = sGrp->GetGroupMembersBegin();
for( ; itr2 != sGrp->GetGroupMembersEnd(); ++itr2 ){
PlayerInfo *p = *itr2;
if( p->m_loggedInPlayer != NULL && p->m_loggedInPlayer->IsVisible( o->GetGUID() ) )
p->m_loggedInPlayer->GetAchievementMgr().UpdateAchievementCriteria( type, miscvalue1, miscvalue2, time );
}
}
Unlock();
}
示例11: SpellTargetNearbyPartyMembers
/// Spell Target Handling for type 33: Party members of totem, inside given range
void Spell::SpellTargetNearbyPartyMembers(uint32 i, uint32 j)
{
TargetsList* tmpMap=&m_targetUnits[i];
// this implementation is wrong.... this one is for totems
if( u_caster != NULL )
{
if( u_caster->GetTypeId()==TYPEID_UNIT)
{
if( static_cast< Creature* >( u_caster )->IsTotem() )
{
float r = GetRadius(i);
r *= r;
Player* p = static_cast< Player* >( static_cast< Creature* >( u_caster )->GetTotemOwner() );
if( p == NULL)
return;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),p,r))
SafeAddTarget(tmpMap,p->GetGUID());
SubGroup * pGroup = p->GetGroup() ?
p->GetGroup()->GetSubGroup(p->GetSubGroup()) : 0;
if(pGroup)
{
p->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = pGroup->GetGroupMembersBegin();
itr != pGroup->GetGroupMembersEnd(); ++itr)
{
if(!(*itr)->m_loggedInPlayer || p == (*itr)->m_loggedInPlayer)
continue;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),(*itr)->m_loggedInPlayer,r))
SafeAddTarget(tmpMap,(*itr)->m_loggedInPlayer->GetGUID());
}
p->GetGroup()->Unlock();
}
}
}
}
}
示例12: SpellTargetNearbyPartyMembers
/// Spell Target Handling for type 33: Party members of totem, inside given range
void Spell::SpellTargetNearbyPartyMembers(uint32 i, uint32 j)
{
// this implementation is wrong.... this one is for totems
if( u_caster != NULL )
{
if( u_caster->GetTypeId()==TYPEID_UNIT)
{
if( TO_CREATURE( u_caster )->IsTotem() )
{
float r = GetDBCCastTime(i);
r *= r;
Player* p = TO_PLAYER( TO_CREATURE(u_caster)->GetSummonOwner());
if( p == NULL)
return;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),p,r))
_AddTargetForced(p->GetGUID(), i);
SubGroup * pGroup = p->GetGroup() ?
p->GetGroup()->GetSubGroup(p->GetSubGroup()) : 0;
if(pGroup)
{
p->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = pGroup->GetGroupMembersBegin();
itr != pGroup->GetGroupMembersEnd(); itr++)
{
if(!(*itr)->m_loggedInPlayer || p == (*itr)->m_loggedInPlayer)
continue;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),(*itr)->m_loggedInPlayer,r))
_AddTargetForced((*itr)->m_loggedInPlayer->GetGUID(), i);
}
p->GetGroup()->Unlock();
}
}
}
}
}
示例13: SpellTargetAllPartyMembersRangeNR
/// Spell Target Handling for type 18: All Party Members around the Caster in given range NOT RAID
void Spell::SpellTargetAllPartyMembersRangeNR(uint32 i, uint32 j)
{
Player* p = p_caster;
if( p == NULL )
{
if( TO_CREATURE( u_caster)->IsTotem() )
p = TO_PLAYER( TO_CREATURE(u_caster)->GetSummonOwner());
else if( u_caster->IsPet() && TO_PET( u_caster )->GetPetOwner() )
p = TO_PET( u_caster )->GetPetOwner();
}
if( p == NULL )
return;
float r = GetDBCCastTime(i);
r *= r;
if( IsInrange( m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), p, r ) )
_AddTargetForced(p->GetGUID(), i);
SubGroup* subgroup = p->GetGroup() ? p->GetGroup()->GetSubGroup( p->GetSubGroup() ) : 0;
if( subgroup != NULL )
{
p->GetGroup()->Lock();
for(GroupMembersSet::iterator itr = subgroup->GetGroupMembersBegin(); itr != subgroup->GetGroupMembersEnd(); itr++)
{
if(!(*itr)->m_loggedInPlayer || m_caster == (*itr)->m_loggedInPlayer)
continue;
if(IsInrange(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),(*itr)->m_loggedInPlayer,r))
_AddTargetForced( (*itr)->m_loggedInPlayer->GetGUID(), i );
}
p->GetGroup()->Unlock();
}
}
示例14: HandlePushQuestToPartyOpcode
void WorldSession::HandlePushQuestToPartyOpcode(WorldPacket &recv_data)
{
CHECK_INWORLD_RETURN;
uint32 questid, status;
recv_data >> questid;
DEBUG_LOG( "WORLD"," Received CMSG_PUSHQUESTTOPARTY quest = %u", questid );
Quest *pQuest = QuestStorage.LookupEntry(questid);
if(pQuest)
{
Group *pGroup = _player->GetGroup();
if(pGroup)
{
uint32 pguid = _player->GetLowGUID();
SubGroup * sgr = _player->GetGroup() ? _player->GetGroup()->GetSubGroup(_player->GetSubGroup()) : 0;
if(sgr)
{
_player->GetGroup()->Lock();
GroupMembersSet::iterator itr;
for(itr = sgr->GetGroupMembersBegin(); itr != sgr->GetGroupMembersEnd(); itr++)
{
Player* pPlayer = (*itr)->m_loggedInPlayer;
if(pPlayer && pPlayer->GetGUID() != pguid)
{
WorldPacket data( MSG_QUEST_PUSH_RESULT, 13 );
data << pPlayer->GetGUID();
data << uint32(QUEST_SHARE_MSG_SHARING_QUEST);
data << uint8(0);
_player->GetSession()->SendPacket(&data);
uint32 response = 0;
//CHECKS IF CAN TAKE THE QUEST
status = sQuestMgr.PlayerMeetsReqs(pPlayer, pQuest, false);
if(status != QMGR_QUEST_AVAILABLE && status != QMGR_QUEST_CHAT)
{
response = QUEST_SHARE_MSG_CANT_TAKE_QUEST;
}
//CHECKS IF QUESTLOG ISN'T FULL
if(pPlayer->GetOpenQuestSlot() == -1)
{
response = QUEST_SHARE_MSG_LOG_FULL;
}
//CHEQUEA SI TIENE LA QUEST EN EL QUESTLOG | CHEKS IF HAVE ALREADY THE QUEST IN QUESTLOG
QuestLogEntry *qst = pPlayer->GetQuestLogForEntry(questid);
if(qst)
{
response = QUEST_SHARE_MSG_HAVE_QUEST;
}
//CHECKS IF ALREADY HAVE COMPLETED THE QUEST
if(pPlayer->HasFinishedQuest(questid))
{
response = QUEST_SHARE_MSG_FINISH_QUEST;
}
//CHECKS IF ALREADY HAVE COMPLETED THE DAILY QUEST
if(pPlayer->HasFinishedDailyQuest(questid))
{
response = QUEST_SHARE_MSG_CANT_SHARE_TODAY;
}
//CHECKS IF IS IN THE PARTY
if(!pGroup)
{
response = QUEST_SHARE_MSG_NOT_IN_PARTY;
}
//CHECKS IF IS BUSY
if(pPlayer->DuelingWith != NULL)
{
response = QUEST_SHARE_MSG_BUSY;
}
if(response > 0)
{
sQuestMgr.SendPushToPartyResponse(_player, pPlayer, response);
continue;
}
data.clear();
sQuestMgr.BuildQuestDetails(&data, pQuest, pPlayer, 1, pPlayer->GetSession()->language, _player);
pPlayer->GetSession()->SendPacket(&data);
pPlayer->SetQuestSharer(pguid);
}
}
_player->GetGroup()->Unlock();
}
}
}
}
示例15: SpellTargetChainTargeting
/// Spell Target Handling for type 45: Chain,!!only for healing!! for chain lightning =6
void Spell::SpellTargetChainTargeting(uint32 i, uint32 j)
{
if( !m_caster->IsInWorld() )
return;
TargetsList* tmpMap=&m_targetUnits[i];
//if selected target is party member, then jumps on party
Unit* firstTarget;
bool PartyOnly = false;
float range = GetMaxRange(dbcSpellRange.LookupEntry(m_spellInfo->rangeIndex));//this is probably wrong,
//this is cast distance, not searching distance
range *= range;
firstTarget = m_caster->GetMapMgr()->GetPlayer((uint32)m_targets.m_unitTarget);
if( firstTarget && p_caster != NULL )
{
if( p_caster->InGroup() )
if( p_caster->GetSubGroup() == static_cast< Player* >( firstTarget )->GetSubGroup() )
PartyOnly=true;
}
else
{
firstTarget = m_caster->GetMapMgr()->GetUnit(m_targets.m_unitTarget);
if(!firstTarget)
return;
}
uint32 jumps=m_spellInfo->EffectChainTarget[i];
if(m_spellInfo->SpellGroupType && u_caster)
{
SM_FIValue(u_caster->SM_FAdditionalTargets,(int32*)&jumps,m_spellInfo->SpellGroupType);
}
SafeAddTarget(tmpMap,firstTarget->GetGUID());
if(!jumps)
return;
jumps--;
if(PartyOnly)
{
GroupMembersSet::iterator itr;
SubGroup * pGroup = p_caster->GetGroup() ?
p_caster->GetGroup()->GetSubGroup(p_caster->GetSubGroup()) : 0;
if(pGroup)
{
p_caster->GetGroup()->Lock();
for(itr = pGroup->GetGroupMembersBegin();
itr != pGroup->GetGroupMembersEnd(); ++itr)
{
if(!(*itr)->m_loggedInPlayer || (*itr)->m_loggedInPlayer==u_caster || !(*itr)->m_loggedInPlayer->isAlive() )
continue;
//we target stuff that has no full health. No idea if we must fill target list or not :(
if( (*itr)->m_loggedInPlayer->GetUInt32Value( UNIT_FIELD_HEALTH ) == (*itr)->m_loggedInPlayer->GetUInt32Value( UNIT_FIELD_MAXHEALTH ) )
continue;
if( sWorld.Collision && u_caster != NULL )
{
if (u_caster->GetMapId() == (*itr)->m_loggedInPlayer->GetMapId() && !CollideInterface.CheckLOS(u_caster->GetMapId(),u_caster->GetPositionNC(),(*itr)->m_loggedInPlayer->GetPositionNC()))
continue;
}
if( IsInrange(u_caster,(*itr)->m_loggedInPlayer, range) )
{
SafeAddTarget(tmpMap,(*itr)->m_loggedInPlayer->GetGUID());
if(!--jumps)
{
p_caster->GetGroup()->Unlock();
return;
}
}
}
p_caster->GetGroup()->Unlock();
}
}//find nearby friendly target
else
{
std::set<Object*>::iterator itr;
firstTarget->AquireInrangeLock(); //make sure to release lock before exit function !
for( itr = firstTarget->GetInRangeSetBegin(); itr != firstTarget->GetInRangeSetEnd(); itr++ )
{
if( !(*itr)->IsUnit() || !((Unit*)(*itr))->isAlive())
continue;
//we target stuff that has no full health. No idea if we must fill target list or not :(
if( (*itr)->GetUInt32Value( UNIT_FIELD_HEALTH ) == (*itr)->GetUInt32Value( UNIT_FIELD_MAXHEALTH ) )
continue;
if (sWorld.Collision) {
if (u_caster->GetMapId() == (*itr)->GetMapId() && !CollideInterface.CheckLOS(u_caster->GetMapId(),u_caster->GetPositionNC(),(*itr)->GetPositionNC()))
continue;
}
if(IsInrange(firstTarget,*itr, range))
{
if(!isAttackable(u_caster,(Unit*)(*itr)))
{
SafeAddTarget(tmpMap,(*itr)->GetGUID());
if(!--jumps)
//.........这里部分代码省略.........