mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
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:
parent
c002f834d4
commit
e38abaa32a
@ -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
|
||||
// Group Leadership AA Mark NPC ability.
|
||||
//
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
if (it->second) {
|
||||
Group *g = nullptr;
|
||||
g = it->second->GetGroup();
|
||||
|
||||
if (g)
|
||||
g->UnMarkNPC(ID);
|
||||
}
|
||||
auto it = group_list.begin();
|
||||
while (it != group_list.end()) {
|
||||
if (*it)
|
||||
(*it)->UnMarkNPC(ID);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user