Optimize EntityList::UnMarkNPC

Going over the group_list is much better than hitting the same group
up to 5 unnecessary times
This commit is contained in:
Michael Cook (mackal) 2014-10-14 22:50:09 -04:00
parent c002f834d4
commit e38abaa32a

View File

@ -4120,15 +4120,10 @@ void EntityList::UnMarkNPC(uint16 ID)
// each group to remove the dead mobs entity ID from the groups list of NPCs marked via the // each group to remove the dead mobs entity ID from the groups list of NPCs marked via the
// Group Leadership AA Mark NPC ability. // Group Leadership AA Mark NPC ability.
// //
auto it = client_list.begin(); auto it = group_list.begin();
while (it != client_list.end()) { while (it != group_list.end()) {
if (it->second) { if (*it)
Group *g = nullptr; (*it)->UnMarkNPC(ID);
g = it->second->GetGroup();
if (g)
g->UnMarkNPC(ID);
}
++it; ++it;
} }
} }