mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-17 18:41: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
|
// 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user